Android Question Drawing filled tringles

dexMilano

Active Member
Licensed User
Longtime User
I've to draw some net-diagram (similar to excel's ones).
Using line I can prepare axes, but the tringles should be filled and I've no idea how to do them.

Is there someone who has a smart example to reuse?
I'm worried about drawing lines to fill them.
I'm looking somethin faster

Any suggestion will be welcome

Thanks

dex

TRIANGLES !!!!
 

dexMilano

Active Member
Licensed User
Longtime User
After a brief study I think DrawPath could be the solution.
I will give it a try.
Thanks stevel05
stay tuned

dex
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
upload_2013-12-11_8-58-52.png


B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim c As Canvas
   c.Initialize(Activity)
   Dim p As Path
   p.Initialize(100dip, 100dip)
   p.LineTo(150dip, 200dip)
   p.LineTo(200dip, 100dip)
   c.ClipPath(p)
   c.DrawColor(Colors.Red)
   c.RemoveClip
End Sub
 
Upvote 0

dexMilano

Active Member
Licensed User
Longtime User
Great!
Last "suggestion" if I need to draw this triangle in a bitmap object (placed with Designer)?
Also, if I've to pain a 2nd bitmap (partially transparent) over the triangle (that is inside the 1st bitmap)?

(I've never used dynamic bitmaps before)
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Last "suggestion" if I need to draw this triangle in a bitmap object (placed with Designer)?
No problem, set the target of the canvas to the view containing the image.
Also, if I've to paint a 2nd bitmap (partially transparent) over the triangle (that is inside the 1st bitmap)?
Is your bitmap already partially transparent ?
Or do you want to draw a partially transparent triangle onto the second bitmap.
Attached a small test ptoject that showa bimap with one button allowing to draw a second bitmat in a triangle on the first bitmap and a second button allowing to draw a partially transparent colored triangle.
 

Attachments

  • DrawPath.zip
    116 KB · Views: 233
Upvote 0

dexMilano

Active Member
Licensed User
Longtime User
Thanks Klaus,
I will check your code.

Exactly I need to
Create an an empty bitmap (trasparent)
Draw the triangle on the bitmap
Draw the 2nd transparent bitmap (the grid) over the triangle
show the bitmap

dex
 
Upvote 0

dexMilano

Active Member
Licensed User
Longtime User
thanks Informatix.
I'm thinking something else (not techical but UX review).
I will keep it in mind

dex
 
Upvote 0
Top