Android Question Zooming canvas with drawing over

dannyjon

Member
Licensed User
Longtime User
I have a canvas that draws a circle when touched. If I zoom the canvas up the circle gets bigger. Is there a way to scale the circle so it looks relative to the zoom factor of the canvas?
 

dannyjon

Member
Licensed User
Longtime User
Tks for reply. It's pinchzoom from the PinchZoomMove demo.
B4X:
Sub PZ_Click (TouchData As TouchData)
    NumView = TouchData.Tag
    ToastMessageShow(NumView & TAB & TouchData.X & " " & TouchData.Y & TAB & imv.Width & " " & imv.Height ,False)
    Dim c As Canvas
    c.Initialize(imv)
    c.DrawCircle(TouchData.X,TouchData.y,10dip,Colors.Red,True,5dip)
    lv.AddSingleLine("Circle at " & TouchData.X & " " & TouchData.y & " TAG: " & NumView)

Also when the app starts the bitmap is not always in the same place even though I code it to be so:
B4X:
bmp = LoadBitmap(File.DirAssets,"img_1.jpg")
        imv.Initialize("")
        imv.Gravity = Gravity.FILL
    imv.Bitmap = bmp
        Activity.AddView(imv,0,0,bmp.Width,bmp.Height)
        imv.left = 0dip
        imv.top = 0dip
 
Upvote 0
Top