Home » Developing U++ » UppHub » PlotCtrl
Re: PlotCtrl [message #22888 is a reply to message #22884] |
Mon, 24 August 2009 21:21   |
|
pveach1 wrote on Mon, 24 August 2009 19:28 |
I would like to see this project expanded into a general charting library. It has a lot of potential especially when combined with the new headless drawing capabilities.
Google has an online charting service. But if they change it, a lot of programs will break.
One of the more confusing things is setting coordinate transformation/translation. I am currently using Win32 API to set xformations. Like this:
XFORM xm_ = { 1, 0, 0, -1, FLOAT(size.cx -100), FLOAT(Offset + size.cy+50)};
HDC hdc = w.GetHandle();
SetGraphicsMode ( hdc, GM_ADVANCED );
SetWorldTransform ( hdc, & xm );
// do something
SetWorldTransform ( hdc, & xm_default ) ; // restore coordinates
This is only valid for WIN2k or later.
I am unsure how U++ draw does xforms.
|
Hi pveach1,
So you suggest to split this into two packages, one containing X independent plotting and second just widget to plot it to for use in GUI? Well, that is an interesting point. It should be possible in principle. I'll definitely think of it and try to implement it.
About the xformations: I haven't used win32 API for years, but if I understand, the snippet you posted just reverses y axis and moves the origin of coordinates, right? If I'm not mistaken, I've seen these capabilities in Painter (and even more, e.g. skew), not so sure about Draw. Anyway, right now, I'm calculating all the screen<->world transforms on painting, so all you really need is SetLimits(x_min,xmax,y_min,y_max) (the y axis is always heading up).
Does that answer your questions?
Bye,
Honza
|
|
|
Goto Forum:
Current Time: Sun May 04 00:04:04 CEST 2025
Total time taken to generate the page: 0.01002 seconds
|