Article ID: 168743 - Last Review: November 21, 2006 - Revision: 4.4 Using HALFTONE Stretching with COLORADJUSTMENT
This article was previously published under Q168743 SUMMARY
This sample demonstrates how to use the HALFTONE stretch mode and some of
the effects that can be generated by using it.
The following file is available for download from the Microsoft Download Center: Halftone.exe
(http://download.microsoft.com/download/platformsdk/sample29/1/w97/en-us/halftone.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
The following files are a contained in Halftone.exe:
MORE INFORMATION
In many cases it is necessary to display bitmaps or DIBs that have a
greater bit depth than your current display mode. To account for this, GDI
has to remap the colors your bitmap uses into the colors that are
available. This remapping process can be slow and often produces
unsatisfactory results. A simple way to produce high quality
representations of your original image is to ask GDI to dither the image
into the palette selected into the target DC. To get GDI to dither the
image you need to use the SetStretchBltMode() API and specify the target DC and the HALFTONE flag. Now, when you want to display your bitmap into the target DC, all you have to do is use StretchBlt() or StretchDIBits() rather than BitBlt() or SetDIBits(). For example:
APPLIES TO
| Other Resources Other Support Sites
CommunityArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top