RE: Printer page physical sizes
Derek Parnell wrote:
>
>
> posted by: Derek Parnell <ddparnell at bigpond.com>
>
> Andy Drummond wrote:
> >
> > I use Win32Lib pretty much exclusively (thank you, Derek), but I just
> > can't find out how to determine the actual physical size of a printer
> > page. I can get it in pixels, but I really want, well, inches, but twips
> >
> > would be the same really. Any ideas from you Windows programming gurus?
> > I'm not too familiar with Win API, I just let people like Rob & Derek &
> > Judith (where IS she?) do it all for me.
> >
>
> Does this help ?
>
>
> PageWidthInMM = w32Func(xGetDeviceCaps,{getDC(Printer), HORZSIZE})
> PageHeightInMM = w32Func(xGetDeviceCaps,{getDC(Printer), VERTSIZE})
>
> and there are 25.4 millimeters in an inch.
>
> Check out the API docs for GetDeviceCaps.
>
> Other codes include ...
>
> DRIVERVERSION -- Device driver version
> TECHNOLOGY -- Device classification
> HORZSIZE -- Horizontal size in millimeters
> VERTSIZE -- Vertical size in millimeters
> HORZRES -- Horizontal width in pixels
> VERTRES -- Vertical width in pixels
> BITSPIXEL -- Number of bits per pixel
> PLANES -- Number of planes
> NUMBRUSHES -- Number of brushes the device has
> NUMPENS -- Number of pens the device has
> NUMMARKERS -- Number of markers the device has
> NUMFONTS -- Number of fonts the device has
> NUMCOLORS -- Number of colors the device supports
> PDEVICESIZE -- Size required for device descriptor
> CURVECAPS -- Curve capabilities
> LINECAPS -- Line capabilities
> POLYGONALCAPS -- Polygonal capabilities
> TEXTCAPS -- Text capabilities
> CLIPCAPS -- Clipping capabilities
> RASTERCAPS -- Bitblt capabilities
> ASPECTX -- Length of the X leg
> ASPECTY -- Length of the Y leg
> ASPECTXY -- Length of the hypotenuse
> LOGPIXELSX -- Logical pixels/inch in X
> LOGPIXELSY -- Logical pixels/inch in Y
> SIZEPALETTE -- Number of entries in physical palette
> NUMRESERVED -- Number of reserved entries in palette
> COLORRES -- Actual color resolution
> PHYSICALWIDTH -- Physical Width in device units
> PHYSICALHEIGHT -- Physical Height in device units
> PHYSICALOFFSETX -- Physical Printable Area x margin
> PHYSICALOFFSETY -- Physical Printable Area y margin
> SCALINGFACTORX -- Scaling factor x
> SCALINGFACTORY -- Scaling factor y
>
> --
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
Derek,
Thank you - that's just what I wanted - and more!!
I have a book - "Win32 Programming" but it is more use
as a door stop. What would you - anyone - recommend as
a good reference on all-round Win32 API rather than just
kerning and other on-screen fancy-pants work?
Andy
|
Not Categorized, Please Help
|
|