News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

What Is a "device unit"

Started by raleeper, March 26, 2009, 12:39:28 AM

Previous topic - Next topic

raleeper

The PSDK documentation uses this term in several places (eg ScrollWindowEx Function), but without definition.
Perhaps the definition is buried in some overview or perhaps it has to be determined by trial and error.
At any rate I can't find it.  Does anyone have the answer?

Thanks

donkey

Device Units are used to allow applications to switch devices more easily without having to adjust window or control sizes. For example a laser printer generally has 300 pixels per inch while your screen usually has 96, so printing a graphic formatted for the screen would result in the image being a little less than 1/3 the size on paper. In order to allow better portability between devices Windows allows for measurement in device units, that are calculated based on the number of pixels per physical inch as opposed to just dealing with pixels (whose size varies). This is especially true of fonts which must be scaled to the device they are being displayed on, a 12 pt font must appear the same on both the screen and printer.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable