473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Mouse over of arbitrary shapes

I can think of a number of ways do detect if the mouse if over (or
clicking on, etc) a arbitrary shaped bitmapped image (say, some sprite
where we want pixel-perfect click detection, not an enclosing
rectangle) , such as some kind of array with a mask in it, individual
lines of the sprite split into tiny rectangles, doing it all on the
server side via an XML request, but I wondered if anyone could offer
their experience or thoughts on the "best" way to do this that doesn't
eat too much client or server resources.
Mar 12 '08 #1
1 1387
am*********@gmail.com wrote:
I can think of a number of ways do detect if the mouse if over (or
clicking on, etc) a arbitrary shaped bitmapped image (say, some sprite
where we want pixel-perfect click detection, not an enclosing
rectangle) , such as some kind of array with a mask in it, individual
lines of the sprite split into tiny rectangles, doing it all on the
server side via an XML request, but I wondered if anyone could offer
their experience or thoughts on the "best" way to do this that doesn't
eat too much client or server resources.
Hi,

What about the good old imagemap?
Google 'imagemap', and you'll find a lot of resources.

You can make arbitrary shapes in it, and define also your JavaScript
handlers.

Here is a quick starters guide:
http://www.w3schools.com/tags/tag_map.asp

Of course you can also homecook your own routine, based on the x and y
position of the mouse over the image, but why reinvent the wheel?

Regards,
Erwin Moller
Mar 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jason | last post by:
Hi, I wish to create a little game where you drag pieces onto a board. I have been playing around with a picture box: Private Sub Picture1_DblClick() Picture1.Left = Picture1.Left + 50 End...
10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
2
by: Sha Crawford | last post by:
How do I hide the mouse pointer in a particular MS Access form? Thanks. Sha Crawford www.sha-crawford.co.uk
1
by: MrNobody | last post by:
I'm going to be creating shapes in a OnPaint method of an extended Panel object, and I need mouse event functionality (onClick, onMouseOver) that kind of stuff... what's the best way to go about...
6
by: Kristian Frost | last post by:
Hi, I'm trying to add, as you might guess, mouseclick listeners to the shapes I am drawing using the GDI+ commands in a similar sort of way as could be done with the old VB "shapes". Problem is,...
3
by: Christie | last post by:
I am writing my app using Visual Studio 2005 (VB.NET). I want to draw images (nothing complex, just lines and shapes) using a mouse. How do one go about achieving this with VB.NET?? If someone...
0
by: alwayssmiling | last post by:
Hi, Im drawing some shapes on the image surface (i.e when im displaying the image ) with the help of graphics. Since i want to move thsese shapes from one place to other place in the...
0
by: weird0 | last post by:
i have successfully emebedded visio drawing tool in my application. Infinite number of shapes can be added to the drawing. How can i write double click event handler for the the shapes added to...
4
by: Sunny | last post by:
Hi I have a div called shape on my page. When I try to get its length using javascript in IE, everything works fine. But When I try it in Firefox it has element has no properties. Here is the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.