Real Software Forums
http://forums.realsoftware.com/

how to get the x and y coordinate
http://forums.realsoftware.com/viewtopic.php?f=6&t=42296
Page 1 of 1

Author:  Bimal [ Wed Jan 18, 2012 2:13 pm ]
Post subject:  how to get the x and y coordinate

Hi All,
I have put an image in canvas control but am not getting the x and y coordinate of the image .so how can i get the coordinate of that image.please give me some code for solve the problem.


Thanks,
Bimal

Author:  charonn0 [ Wed Jan 18, 2012 3:49 pm ]
Post subject:  Re: how to get the x and y coordinate

You would have set the X and Y coordinates of the Picture when you drew the picture to the canvas:

Sub Paint(g As Graphics)
g.DrawPicture(MyPic, 0, 0)
End Sub


In the above case, the X and Y are both 0.

If you're trying to calculate the X, Y of the Picture relative to the whole window or to the whole screen rather than relative to the top left of the Canvas, then add the X, Y of the Picture in the canvas to the X, Y of the Canvas or the Window, respectively.

Author:  timhare [ Wed Jan 18, 2012 6:29 pm ]
Post subject:  Re: how to get the x and y coordinate

What do you mean by "I have put an image in canvas control"? Did you set is as the Backdrop? Or are you drawing it in the Paint event? And which X,Y are you referring to?

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/