Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 Need help on coordinate transformation

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
soundar Posted - 17 Nov 2008 : 19:28:23
I want to draw a circle on a x-y graph using RTGenshape. the circle should always be centered at a specific (x,y) location in the graph, say (-10,20) even as the xaxis min,max and yaxis min-max change. (We can assume that (-10,20) is always within the current plot area). In addition, the circle should always be of a fixed diameter specified in device coordinates say, always 3 mm (or always 10 pixels), regardless of the plot scaling.

How can I achieve this?
3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 22 Nov 2008 : 10:38:59
You are creating problem where they don't exist. The ChartSymbol symbols are centered on the specified location. Run the code fragment we posted and you will see this.


soundar Posted - 21 Nov 2008 : 17:34:43
This may not solve my problem. If I understand it correctly, the chart symbol SetLocation refers to the top,left corner of the enclosing rectangle. If I want the circle to be CENTERED at -10,20, and I want the circle to be say 12 pixels radius, then I want the top left corner at

x = -10 - (12 * plotUnits/pixel)
y = 20 - (12 * plotUnits/pixel)

How do I get transform 1 plot unit to equivalent pixel units?

Thanks

quinncurtis Posted - 18 Nov 2008 : 13:50:28
It's easiest to use the ChartSymbol class, which already has a CIRCLE type defined. The SymbolSize is specified in pixels, the location in the current plot scale.

ChartAttribute attrib4 = new ChartAttribute(Color.Red, 1, DashStyle.Solid);
attrib4.SymbolSize = 64;
ChartSymbol circle = new ChartSymbol(pTransform1, ChartObj.CIRCLE, attrib4);
circle.SetLocation(-10, 20);
chartVu.AddChartObject(circle);

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07