|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Trouble with pixelsgraphics. After graphing my X-Y data I want to do some measurements on that curve using a crosshair cursor. So I a made a MouseDoubleClick event with the following code: Dim position as Point position=Control.MousePostion tijd=position.X height=position.Y Now it seems that the height is in screencoordinates, not in graphicscoordinates, e.g. if I doubleclick on the topline of my rectangle I get height=76 pixels, instead of 50 pixels (the difference of 26 pixels is the height of the forms titelbar). This difference of course becomes larger with a form that is not maximized. Now I can live with that by always using a maximized screen and substracting 26 from the position.Y, but that does not seems not very elegant. Is there a better way to get the coordinates in a graphics window in graphicscoordinates? -- Groeten, Jaap Bos Jaap Bos wrote:
> Is there a better way to get the coordinates in a graphics window in Control.PointToClient and Control.PointToScreen will convert back and > graphicscoordinates? forth for you. -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version "Larry Lard" <larryl***@googlemail.com> Thank you Larry, you solved my problem!> Jaap Bos wrote: >> Is there a better way to get the coordinates in a graphics window in >> graphicscoordinates? > > Control.PointToClient and Control.PointToScreen will convert back and > forth for you. > As an afterthought, I find, as a newbie, that it is rather difficult to get a grasp of the possibilities of using graphics in VB2005. I read the Michael Halvorson Step by Step book and watched the Microsoft online video's. After this I have some knowledge about VB-programming, but I still know nil about graphics, apart from drawing a line or a rectangle. Befor I asked my question I looked into the Help-index of VB but really could not find the answer that you gave me. Can you point me to a (not to advanced :-) ) book or online material on VB-graphics? Thanks again, Jaap Jaap Bos wrote:
Show quoteHide quote > "Larry Lard" <larryl***@googlemail.com> Bob Powell's excellent website is my first port of call whenever I have >> Jaap Bos wrote: >>> Is there a better way to get the coordinates in a graphics window in >>> graphicscoordinates? >> Control.PointToClient and Control.PointToScreen will convert back and >> forth for you. >> > > Thank you Larry, you solved my problem! > > As an afterthought, I find, as a newbie, that it is rather difficult to get > a grasp of the possibilities of using graphics in VB2005. > I read the Michael Halvorson Step by Step book and watched the Microsoft > online video's. > After this I have some knowledge about VB-programming, but I still know nil > about graphics, apart from drawing a line or a rectangle. > Befor I asked my question I looked into the Help-index of VB but really > could not find the answer that you gave me. > Can you point me to a (not to advanced :-) ) book or online material on > VB-graphics? a graphics issue: <http://www.bobpowell.net/> -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version "Larry Lard" <larryl***@googlemail.com> schreef Jaap Bos wrote:>> Can you point me to a (not to advanced :-) ) book or online material on Thanks Larry. Looks like that this site will keep me occupied for a while >> VB-graphics? > > Bob Powell's excellent website is my first port of call whenever I have a > graphics issue: > > <http://www.bobpowell.net/> > > -- > Larry Lard :-) . Jaap Bos
Can a .NET Web Service be accessed from a VB6 Client?
Is there a statement that will completely empty a listbox? Event handlers Quesion about ADO.NET in VB.NET Threading Question Reporting options in vb 2005 How to code image path relative to project Tip of The Day is My.Settings version specific? Application Priority |
|||||||||||||||||||||||