Image/area manipulation (like hot spot or image map)

  • Thread starter Thread starter Alp Bekisoglu
  • Start date Start date
A

Alp Bekisoglu

Hi Experts,

Got stuck on an idea and would appreciate any help, guidance. Using A2K. I
have an image of a housing area on the form. What I intend to do is to be
able to define several areas on the image and when clicked on, it will open
another form based on a criteria. Just like image mapping in HTML.
At present, I have textboxes doing what I want but it looks unprofessional
since when the textbox is clicked, it's content (a house number) is selected
for editing.
I hope I have given sufficient explanation to what I would like to
accomplish.

Thanks in advance.

Alp
 
If you use the MouseDown (or MouseUp) event of the image control, Access
gives you offset values from the top left of the image. The values (X and Y)
are typically in twips, where 1440 twips = 1 inch. You can use this
information to determine which part of the image was clicked, and respond
appropriately.

Just FYI, you can set the Locked property of a text box if you don't want
the user to edit it, or its Enabled property if you don't even want the user
to select it.
 
Alp,

One way you could do it is to read the colour of the pixel that the
user clicks on and then use a look up table to determine what action
to take for each colour code. This method would allow you to have any
shape of image in any colour.

I have written a small demo program in Access 2000 or later which
shows how to do this, it has only a few lines of code. If you (or
anyone else) would like a copy just email me at
(e-mail address removed)_SPAM (omit the .NO_SPAM part of course)
and I would be happy to send it on.

Peter Hibbs.
 
Hi Allen,

Thanks for your post. For each houseno field, I have set enabled=yes and
locked=yes, due to enabled property, the contents are selected. But
otherwise, I can't get my code working. I will need to look into the
MouseDown event I guess. It will take quite some time to figure out the
correct coordinates of each of the 116 houses though! :-(
Wish there was an easier way to accomplish.

Alp
 
Hi Peter,

Thanks for the offer, just in case I will mail you. The main problem I would
think of could be that all house no's are in black text and it would be
tricky to alter the color for all 116 of them.
I was at least hoping to do something with respect to pixels which would be
much easier to find out in a graphics program.

Alp
 
Alp,

Yes, I can see that that would be tricky with 116 images/colours. Are
the house number images always in the same position on the form. Could
you use 116 buttons with the Transaparent property set to Yes, the
buttons will not show on the form but the Click events still work. You
can then set the size and position of the buttons to suit and if you
named the buttons to be the same as the house numbers you could make
the code relatively simple. It's still a lot of buttons for a form
though.

Peter Hibbs.
 
Voila!

Thanks a lot Peter that really did what I need in the end! Wonder why one's
brain stops sometimes... transparent buttons never came to my mind actually.
In a way they "are" image maps with respect to HTML code. I don't mind 116
buttons, since I already had to create 116 textboxes earlier anyway. :-)
Now I whish we could define slanted rectangle buttons (pushing my luck a bit
too far right?) so they would have completely matched the building
footprints.

Thanks again Peter, have a great day!

Alp
 
Alp,

Glad to help and I don't know of any way to change the shape of a
standard button. I suppose you could create a lot of small
transaparent picture images of the required shape and use them as
buttons but that sounds like a lot of work to me.

Peter Hibbs.
 
Hi Experts,

Got stuck on an idea and would appreciate any help, guidance. Using A2K.
I have an image of a housing area on the form. What I intend to do is to be
able to define several areas on the image and when clicked on, it will open
another form based on a criteria. Just like image mapping in HTML.
At present, I have textboxes doing what I want but it looks unprofessional
since when thetextboxis clicked, it's content (a house number) is selected
for editing.
I hope I have given sufficient explanation to what I would like to
accomplish.

Thanks in advance.

Alp


Alp,

It looks like you have a pretty good handle on your needs
from other posts if you just want rectangular hotspots,
but you may still be looking for how to get hotspots of
different shapes - not just rectangles.

Check out our MetaDraw 3 OCX component which you
can use on an Access form to hold a picture and hotspots
of any shape. You can draw the hotspots with your mouse,
( we even have a utility included with MetaDraw to allow
you to draw these hotspots ), or you can create in code
by adding a polygon shape and specifying the coordinates.
You can have the mouse automatically update over a hotspot,
you can trap events when the mouse is clicked, double clicked,
or simply moves over a hotspot. Every hotspot can have
multiple pieces of associated data for example - a name,
a house number, a database record ID, etc.

Also - you can merge images - for instance start
with a map and add icons for the houses ( or other objects ).
Then let the user select a mouse. You can if you want even
allow the user to move the icons by dragging. And of course
each merged element can be a hotspot as well.

You can also scroll and zoom the image - together with the hotspots

For information refer to
www.bennet-tec.com/BTProducts/MetaDraw/MetaDraw.htm
You can also see MetaDraw in action within a web page
www.bennet-tec.com/btproducts/MetaDraw/WebSamples/MD3Map/md3_map.htm
OR
www.bennet-tec.com/btproducts/MetaDraw/WebSamples/Hotspots/md3_HotspotDemo.htm

And you can download the MetaDraw install kit to try it out
in evaluation mode
http://www.bennet-tec.com/btproducts/metadraw/installkit/md3_inst.zip


Also let me know whether this seems of any interest
to you, and whether you have any questions


* * Please include a copy of this message with any reply on this topic

Jeff Bennett
(e-mail address removed)


* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* WWW.Bennet-Tec.Com

RELIABLE Component Software
and Custom Software Development Services

* Expert Systems * Text Processing
* Databases * Interactive Web Sites
* Diagramming, Drawing, Hotspot Graphics
* Data Input & Data Presentation Systems
* Desktop Windows, Tablets, Pocket PCs

TList™ / ALLText™ / MetaDraw™ / Web Signature™

=================== ===================

-------------------------------------------------------------------------------------
 
Back
Top