🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #19

Re: Using world coordinates in a window

#19
From: Tom W. Brown
Date: Tue, 27 Oct 1992 21:17
23 lines
1643 bytes
In article <92301.084732F0O@psuvm.psu.edu>, F0O@psuvm.psu.edu writes:
|> 
|>    I've written an application where the window's X world coordinates go
|> from -77.4 to -76.2 and the Y world coordinates go from 40.1 to 40.9.  I
|> couldn't find a way of setting this up using any of the windows routines,
|> so I wrote my own.  Is there a way of directly doing this in windows without
|> having to write your own routines?

GDI has an integer based coordinate system and doesn't directly support
floating point coordinates.  You will have to transform your "real" world
coordinate system into GDI's "logical" world coordinate system.

If all you need are three significant digits then scale by 10 and use X
world coordinates of -774 to -762 and Y coordinates from 401 to 409.  You 
could also scale by 100 and still fit in the integer sized address space of
GDI.


----------------------------------------------------------------------------
Tom Brown               |  "Strange women, lying in ponds, distributing
PE Nelson Systems       |   swords is no basis for a system of government."
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID: <667@lax.lax.pe-nelson.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
References: <92301.084732F0O@psuvm.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Using world coordinates in a window
Message-ID: <667@lax.lax.pe-nelson.com>
Date: 27 Oct 92 21:17:58 GMT
References: <92301.084732F0O@psuvm.psu.edu>
Sender: news@lax.pe-nelson.com
Organization: PE-Nelson
Lines: 23