D dannyjon Member Licensed User Longtime User Mar 15, 2017 #1 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?
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?
Erel B4X founder Staff member Licensed User Longtime User Mar 15, 2017 #2 How are you zooming the canvas? Can you post a screenshot? Upvote 0
D dannyjon Member Licensed User Longtime User Mar 15, 2017 #3 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
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