New topic: How to find x/y offset for Canvas?
<http://forums.realsoftware.com/viewtopic.php?t=46235> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message tseyfarth Post subject: How to find x/y offset for Canvas?Posted: Thu Dec 13, 2012 3:23 pm Joined: Sat Dec 04, 2010 9:14 pm Posts: 790 Hello All, Can anyone tell me how to find the x/y offset so that control coordinates are accurate? The help shows: Quote:The left side of the control in local coordinates (relative to the window). I am using Graphics.Pixel to find the boundaries created by a background image. However the reported X/Y coordinates are always wrong. I can approximate the offset, but would rather do this the proper way! Thanks all! Tim Top timhare Post subject: Re: How to find x/y offset for Canvas?Posted: Thu Dec 13, 2012 4:49 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 11882 Location: Portland, OR USA Where are you getting the coordinates? There are 3 "domains" for coordinates - system, window, control. Depending on how you obtain the coordinates - eg., MouseDown vs. System.MouseX, you may have to translate the coordinates into your canvas space. Oh, and ContainerControls add a whole nother set of possibilities. Top tseyfarth Post subject: Re: How to find x/y offset for Canvas?Posted: Thu Dec 13, 2012 5:15 pm Joined: Sat Dec 04, 2010 9:14 pm Posts: 790 Hi Tim, I was getting them from the mousedown event of a Canvas. I did get it fixed, but now I think it is broken again... There is a scroll bar on the window. So when the scroll (canvas) is activated, that throws the whole thing off. I guess I have to incorporate the scroll offset too. Tim Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
