IonicWind Software

IWBasic => General Questions => Topic started by: Brian on January 19, 2007, 09:18:49 AM

Title: Draw RECT to specific size
Post by: Brian on January 19, 2007, 09:18:49 AM
Hi,

How can I draw a rectangle to a specific size - I want to draw one 350mm x 450mm, irrespective
of what the Logpixels are

Any ideas?

Brian
Title: Re: Draw RECT to specific size
Post by: Ionic Wind Support Team on January 19, 2007, 09:36:54 AM
There are a number of ways to approach this. 

1) You could use logpixels to create a conversion from disply dpi to mm.  Which would be compatible with the autodrawn windows.
2) You can change the mapping mode of the window to MM_LOMETRIC then any drawing command coordinates are in .1 mm instead of 1 pixel.  To do this you'll need a non autodrawn window by specifying @NOAUTODRAW as a window creation flag and draw everything in response to @IDPAINT.

Microsoft describes the mapping modes here:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnargdi/html/msdn_mapping.asp

Paul.
Title: Re: Draw RECT to specific size
Post by: Brian on January 24, 2007, 10:48:50 AM
Thanks, Paul - just seen your reply . . .

Brian