Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 How to get screen coordinates for alignment.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BarryRobertson

USA
21 Posts

Posted - 19 Nov 2012 :  14:44:29  Show Profile  Reply with Quote
I am looking at DataCursorsAndMarkers as an example. What I need is a control (for touch screen) that a user can drag left/right across the bottom of the graph, moving a vertical marker (and of course I need to get the values of my plots that intersect the marker).

What I was immediately trying to figure out was how to get the screen positions for the left and right side of the plot area so that I can position my control (think of it as a track-bar with a pointer pointing up). The position needs to be about 47 pixels left of the plot and then over 47 to the right of the plot (since it's 95 pixels wide) (see example below if it displays well).

I have my trackbar minimum and maximum set corresponding to the plot area's time axis that is visible. I currently do not have this control inside my graph object (it's external, but directly beneath).

I haven't found the right thing to get "real" coordinates on the screen of the left/right of the plot. It seemed like I could query something to get the position/bounding box of the x-axis, but I didn't get data that made sense.

My slider control looks similar to this (dots for spacing here).

_____/\_____
|............|________________________________________________
|____________|

The pointer part (pointing up) needs to align with the left of my plot when all the way left, and align with the right of the plot area when all the way to the right.

If I'm doing this completely wrong, creating an issue where there shouldn't be one, that would be nice to know.

Thanks for your help.

quinncurtis

1586 Posts

Posted - 19 Nov 2012 :  23:20:34  Show Profile  Reply with Quote
The pixel boundaries of the plotting area, normally the area bounded by the axes, can be retrieved using the coordinate systems GetPlotRect()method.

Rectangle2D plotrect = pTransform1.getPlotRect();
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07