drawing image then finding out if it was clicked

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Hello,

I want to draw a image on the screen using GDI+ then find out if it was
clicked on. Do i need to create an object then draw the image into the
object and place it at the location then trap the objects events, or can you
draw an image and find out somehow if it was clicked on or the mouse is
rolled over it? I would think the second one was harder... i posted a
previous message like this on 3/13/2004 but no one replied so i am trying to
get additional information here on a slightly diffrent thing. thanks!
 
Hi,

I made my own image class which loaded an image file, displayed it and
responded to a Click(CDC*, CPoint*) but I did it in C/C++. I suppose it
would be the same in VB, make it a class which loads and displays the image
and then have Click(Point) as a member function returning 'true' if clicked.

Paul
 
if you are thinking of creating vector graphics, then I would suggest using
regions. You can do a hit test for a region by calling
Region.IsVisible(x,y). Or if you just wanna do it with that image, you have
to simply check if the x and y coordinate of the mouse-click falls withing
the bounds of the picture that you've drawn
 
Back
Top