[Gambas-user] Click image get coordinates

Tobias Boege taboege at ...626...
Wed May 22 17:06:32 CEST 2013


On Wed, 22 May 2013, Marco wrote:
> Hi all,
> 
> I'm trying to write something so that I can display an image (a map of a 
> building). On this image several temperature probes are displayed. I'd 
> like to click the image on specific regions and want a textbox to be 
> filled with the temperature value of this probe.
> 
> The real problem isn't the connection to the probes and displaying the 
> values in the textbox. I allready made this work with normal buttons and 
> no image. But to make it more fancy I'd want to use the image with the 
> nice map of the building. This way it's more understanding for everyone 
> using it.
> 
> I allready tried to get coordinates out of clicking on the image, but 
> without any results.
> 
> Hope there is a solution for this.
> 

I'd display the picture in a PictureBox and then do it like image maps in
HTML. You can use the MouseUp events to capture a click.

I think it's better to just show you an example. Attached. Not the prettiest
one and you may have better algorithms to search for a region but you get
the idea.

Regards,
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imagemap-0.0.1.tar.gz
Type: application/octet-stream
Size: 5850 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130522/cf8750b7/attachment.obj>


More information about the User mailing list