🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #312

halftone on printing

#312
From: Berthold K.P. Horn
Date: Sat, 11 Apr 1992 22:21
27 lines
1696 bytes
I found the answer to the question I posed a while ago, namely how to get
printer drivers to use halftoning when you display a bitmap image.

Turns out I was using StretchBlt, which works fine on screen, and may be the
preferred method for putting things up on screen.

For printing it is better to use StretchDIBits, which apparently is better
supported by printer drivers such as PSCRIPT and HPGLL.  

One unfortunate feature of a complex system like Windows is that there are
usually several different ways of doing something, with sometimes little
indication which of these ways is an old way, which is widely supported,
which has bugs, etc Just lots of experimentation needed.

Worse yet, one would imagine that in an ideal world, all GUI calls work fine
no matter what DC one is talking to.  But instead it turns out that some
things work for video drivers, others for printer drivers, yet others for
MetaFiles.  Which is understanable, given the vastly different properties.
But wouldn't it be nice if up front you knew which things to avoid because
they don't work in one or another domain - rather than having to rewrite a
lot of stuff later when you decide to expand horizons to a new type of DC?

Anyway I get half-tones now on the PS printer.  Thanks.  Berthold.

Berthold K.P. Horn
Cambridge, Massachusetts, USA
Technical Details
Message-ID: <23302@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!hri.com!snorkelwacker.mit.edu!ai-lab!wheat-chex!bkph

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!hri.com!snorkelwacker.mit.edu!ai-lab!wheat-chex!bkph
From: bkph@wheat-chex.ai.mit.edu (Berthold K.P. Horn)
Newsgroups: comp.windows.ms.programmer
Subject: halftone on printing
Message-ID: <23302@life.ai.mit.edu>
Date: 11 Apr 92 22:21:41 GMT
Article-I.D.: life.23302
Sender: news@ai.mit.edu
Lines: 27