Posted by
Peter Kenny-2 on
Jul 11, 2004; 11:15pm
URL: https://forum.world.st/Drawing-graphs-iin-Dolphin-tp3370875p3370963.html
Stefan,
"Stefan Schmiedl" <
[hidden email]> wrote in message
news:
[hidden email]...
> On Tue, 6 Jul 2004 11:45:37 +0100,
> Peter Kenny <
[hidden email]> wrote:
> Don't let yourself become confused by the way Windows names concepts.
>
A bit late - I am thoroughly confused, though the fog is lifting a bit. I
have a method which works, though I'm not quite sure how, and I shall stick
to it!
> Viewport coordinates refer to "device units", commonly known as pixels.
> Window coordinates refer to "logical units" used by your program.
>
> The relationship between those two is governed by a concept called
> MapMode. Your data point windowExtent = viewportExtent = 1@1 only means
> that you're working with pixel based coordinates and that the y-axis
> points down.
>
> You should also find a viewportOrigin and a windowOrigin.
> The viewportOrigin contains the "absolute" position of the origin in
> device units and is useful if you want to put the origin into the lower
> left corner of the window.
> The windowOrigin determines where your "logical" origin lies in
> relationship to this point.
>
I think I see this, but I seem to have found a way round it by following
Chris Uppal in working with the client rectangle. I know that my coordinates
are in pixels relative to this rectangle.
> As long as you have GDI-friendly coordinates, you can exchange the
> headache caused by manual scaling and shifting for the headache
> necessary to understand how MM_ANISOTROPIC et al. work.
>
> BTW: There is almost no difference between drawing into a window and
> drawing into a WMF or EMF file. You won't need ActiveX components to
> display those, either, as Windows has builtin functions for handling
> this kind of tasks.
This looks interesting, and I shall try to follow this up when I can. I am
using screen based graphs only at present, but when I want presentation ones
I shall know what to do.
>
> I found the Win32-API help file (old version, available for download)
> enormously helpful. And much more useable than that modern HTML-help
> monstrosity.
>
> s.
Thanks for the tip. I think I may have a copy on my old machine.
Thanks and best wishes
Peter