Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Dec 11, 2019 2:58 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: how to get the x and y coordinate
PostPosted: Wed Jan 18, 2012 2:13 pm 
Offline

Joined: Mon Jan 16, 2012 8:08 am
Posts: 161
Location: India
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


Top
 Profile  
Reply with quote  
 Post subject: Re: how to get the x and y coordinate
PostPosted: Wed Jan 18, 2012 3:49 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
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.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: how to get the x and y coordinate
PostPosted: Wed Jan 18, 2012 6:29 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group