Hi,
I am looking for a solution to draw something on a panel? I found some samples in multitouch Using Agraham's Gestures library here -> Actually that sample is very similar to what i am looking for but is complicated for me as i am a beginner and my point is not related with multi touch... I am not related with multi touching functions...
Is there any simple way for this without using multi gesture? Single touch is enough for me for this project ?
And is it possible to save my drawings as image files ?
Instead of Bitmap1 you have to give your ImageView name.
Edit@
Here's some very basic drawing:
B4X:
Sub Globals
Dim Canvas1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
Canvas1.Initialize(Activity) 'Initialize the canvas (drawer) and makes it draw on the activity (form).
End Sub
Sub Activity_Touch(Action As Int, tx As Float, ty As Float)
Canvas1.DrawCircle(tx, ty, 5dip, Colors.Red, False, 2dip)
Activity.Invalidate3(tx - 7dip, ty - 7dip, tx + 7dip, ty + 7dip)
End Sub
I assume you are doing several circles to fill it. If so, instead of
B4X:
Sub Activity_Touch(Action As Int, tx As Float, ty As Float)
Canvas1.DrawCircle(tx, ty, 5dip, Colors.Red, False, 2dip)
Canvas1.DrawCircle(tx, ty, 4dip, Colors.Red, False, 2dip)
Canvas1.DrawCircle(tx, ty, 3dip, Colors.Red, False, 2dip)
Canvas1.DrawCircle(tx, ty, 2dip, Colors.Red, False, 2dip)
Canvas1.DrawCircle(tx, ty, 1dip, Colors.Red, False, 2dip)
Activity.Invalidate3(tx - 7dip, ty - 7dip, tx + 7dip, ty + 7dip)
End Sub
Why not
B4X:
Sub Activity_Touch(Action As Int, tx As Float, ty As Float)
Canvas1.DrawCircle(tx, ty, 5dip, Colors.Red, True, 2dip)
Activity.Invalidate3(tx - 7dip, ty - 7dip, tx + 7dip, ty + 7dip)
End Sub
As the flag after the colour is for filled or not filled.