Re: Change resulution (DPI) of a device context

From: Schmidt (sss_at_online.de)
Date: 01/26/05


Date: Wed, 26 Jan 2005 16:36:01 +0100


"Martin Enke" <martin-enke@online.de> schrieb im Newsbeitrag
news:uMd10pyAFHA.3084@TK2MSFTNGP11.phx.gbl...

> When creating a enhanced meta file the resolution is set to the resolution
> of the device context.
> Now, I have two ways to influence the resolution: Choosing a dc compatible
> to the display which meens 96 DPI or choosing a dc compatible to a
printer.
> I need a printer compatible meta file, so it would be ok if there wheren't
> some users who have no printer!

Creating the MetaFile compatible to the current ScreenDC (Param to Null in
the CreateEnhMetaFile-Function) is the only way that does work on every PC.
Typically the Resolution is 96dpi and the Fonts < 9Pt look terrible, if
played against a Printer-hdc.
There was no way, to significant enhance the quality of the Font-Playback
with SetViewPortExt in combination with SetWindowExt.
So we ended up with a simple but effective solution:
All our drawing-functions go through a class-layer and work on
millimeter-Basis.
So it was easy for us, to define (in addition to the mm-Constants) a global
ScaleConstant and enhance the resolution this way.
Our Himetric-Rect (normally A4 with 21000x29700) used in CreateEnhMetaFile
was enlarged by this factor (4 works good, so we calculated 84000x118800).
All Drawing-Functions respect this additional factor now and draw factor 4
larger Rectangles, Fonts, etc.
Aspect-Ratio is the same, so playback on the Printer-hdcs works with no
problems and much better rendered fonts.
Only drawback is, that the so created *.emf-files show a size in
3rd-party-apps, wich equals the A2-Format.
For us there was no problem, since we use our Report-Format (wich is
additionally compressed with zlib) only inside our own Apps.

Olaf



Relevant Pages

  • Re: Mac Market Share: Reading those numbers
    ... Your average computer screen is not a low resolution device. ... With the exception of the handful of fonts specifically ... Let's say you're rendering on-screen text, ... You can round it to one pixel wide, which is going to make it look ...
    (comp.sys.mac.advocacy)
  • Re: Taskbar fonts and icons
    ... Switching to a lower screen Resolution should not effect the quality of the images. ... I set the taskbar at large icons and fonts. ...
    (microsoft.public.windowsxp.general)
  • Re: Tungsten C out of stock
    ... You're erroneously assuming that fonts will stay ... > resolution is that many things are +not+ scaling. ... LCD screens. ... lighter and stronger than glass with the same clarity. ...
    (comp.sys.palmtops.pilot)
  • Re: [opensuse] Accessibility questions
    ... And setting the virtual screen resolution larger than the ... My current display is 1024*768, but when using larger resolutions the fonts display smaller, instead of the same size. ... designers are increasingly assuming higher minimum resolutions - often ...
    (SuSE)
  • Re: Default Gnome2 Font
    ... resolution: 124x125 dots per inch ... For now i modify manually the fonts and fonts size from "Appereance" ... Infact if i here define a "Resolution: 96 dots per inch", ...
    (Debian-User)

Loading