dexMilano Active Member Licensed User Longtime User Dec 10, 2013 #1 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 !!!!
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 !!!!
derez Expert Licensed User Longtime User Dec 10, 2013 #2 Maybe a predrawn bitmap of a triangle stretched according to need ? Upvote 0
dexMilano Active Member Licensed User Longtime User Dec 10, 2013 #4 After a brief study I think DrawPath could be the solution. I will give it a try. Thanks stevel05 stay tuned dex Upvote 0
After a brief study I think DrawPath could be the solution. I will give it a try. Thanks stevel05 stay tuned dex
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2013 #5 Code: Copy 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
Code: Copy 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
klaus Expert Licensed User Longtime User Dec 11, 2013 #6 Hi Erel, Is there an advantage to use this code Code: Copy c.ClipPath(p) c.DrawColor(Colors.Red) c.RemoveClip rather than this one ? Code: Copy c.DrawPath(p, Colors.Red, True, 1) Upvote 0
Hi Erel, Is there an advantage to use this code Code: Copy c.ClipPath(p) c.DrawColor(Colors.Red) c.RemoveClip rather than this one ? Code: Copy c.DrawPath(p, Colors.Red, True, 1)
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2013 #7 No. I forget about this method Both options are good. With the ClipPath solution you can also draw images or Drawables. Upvote 0
No. I forget about this method Both options are good. With the ClipPath solution you can also draw images or Drawables.
dexMilano Active Member Licensed User Longtime User Dec 11, 2013 #8 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
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)
klaus Expert Licensed User Longtime User Dec 11, 2013 #9 Last "suggestion" if I need to draw this triangle in a bitmap object (placed with Designer)? Click to expand... 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)? Click to expand... 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 DrawPath.zip 116 KB · Views: 437 Upvote 0
Last "suggestion" if I need to draw this triangle in a bitmap object (placed with Designer)? Click to expand... 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)? Click to expand... 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.
dexMilano Active Member Licensed User Longtime User Dec 11, 2013 #10 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
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
Informatix Expert Licensed User Longtime User Dec 12, 2013 #11 Forget the canvas and start using my Accelerated Canvas library. You will get more possibilities, anti-aliased lines and a faster drawing. Upvote 0
Forget the canvas and start using my Accelerated Canvas library. You will get more possibilities, anti-aliased lines and a faster drawing.
dexMilano Active Member Licensed User Longtime User Dec 13, 2013 #12 thanks Informatix. I'm thinking something else (not techical but UX review). I will keep it in mind dex Upvote 0
thanks Informatix. I'm thinking something else (not techical but UX review). I will keep it in mind dex