What I am wanting to do is place bitmaps on various areas of the scaleimageview. I can place a bitmap but it gets removed when I place another one on it. If I can get this solved then the next question is how would I save it to a file.
Here is how I am placing the bitmap. I am guessing from the comment that the OnDraw event automatically redraws. I have tried to do the draw in the click using my own canvas but no luck.
Here is how I am placing the bitmap. I am guessing from the comment that the OnDraw event automatically redraws. I have tried to do the draw in the click using my own canvas but no luck.
B4X:
Sub ScaleImageView1_Click 'The user has tapped on the view. Use ClickImage or ClickView for the coordinates.
Dim siv As ScaleImageView = Sender
imagex = siv.ClickImageX
imagey = siv.ClickImageY
' siv.Invalidate ' draw the new position
End Sub
Sub ScaleImageView1_OnDraw(viewcanvas As Canvas) 'The view is being redrawn. Use viewcanvas to draw on it.
Dim siv As ScaleImageView = Sender
Dim viewxy() As Float = siv.SourceXYtoViewXY(imagex, imagey)
Dim r As Rect
r.Initialize(viewxy(0), viewxy(1), viewxy(0) + 30dip, viewxy(1) + 30dip)
viewcanvas.DrawBitmap(bmpGermany, Null, r)
siv.Invalidate2(r)
End Sub