boten Active Member Licensed User Longtime User Feb 7, 2016 #1 I have an imageview on a form. If left empty (no setimage) then it does not repond to mousedclicked event. If filled with an image - it DOES respond. If filled with image and then "written on" with canvas.drawtext then again does NOT respond. How to make an imageview responsive to mouseclick when empty or when drawtext on it?
I have an imageview on a form. If left empty (no setimage) then it does not repond to mousedclicked event. If filled with an image - it DOES respond. If filled with image and then "written on" with canvas.drawtext then again does NOT respond. How to make an imageview responsive to mouseclick when empty or when drawtext on it?
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2016 #2 By default the ImageView is only clickable in the non-transparent areas. You can change its behavior with this code: Code: Dim jo As JavaObject = ImageView1 jo.RunMethod("setPickOnBounds", Array(True)) Upvote 0
By default the ImageView is only clickable in the non-transparent areas. You can change its behavior with this code: Code: Dim jo As JavaObject = ImageView1 jo.RunMethod("setPickOnBounds", Array(True))
boten Active Member Licensed User Longtime User Feb 8, 2016 #3 I tried. Can u tell what's wrong with this code? (project attached) Attachments ivclk.zip ivclk.zip 2.2 KB · Views: 339 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2016 #4 You have put the Canvas over the ImageView so it intercepts the click. Disable the Canvas to let the ImageView handle the clicks: Code: cv.Enabled = False BTW, you should add the canvas with the designer. Upvote 0
You have put the Canvas over the ImageView so it intercepts the click. Disable the Canvas to let the ImageView handle the clicks: Code: cv.Enabled = False BTW, you should add the canvas with the designer.
DonManfred Expert Licensed User Longtime User Feb 8, 2016 #5 You are adding a canvas above the imageview. The canvas is above your imageview and the click will be absorbed by the canvas Edit: dammit; too slow Last edited: Feb 8, 2016 Upvote 0
You are adding a canvas above the imageview. The canvas is above your imageview and the click will be absorbed by the canvas Edit: dammit; too slow