Article View: borland.public.cppbuilder.nativeapi
Article #13158Color mapping of a bitmap
From: Martin Golm
Date: Wed, 29 Oct 2003 14:35
Date: Wed, 29 Oct 2003 14:35
13 lines
1473 bytes
1473 bytes
I have a monochrome bitmap (16x16 pixels) I load from a resource. Now I need to set the white pixels to one color (let's say yellow), and the black pixels to another color (let's say red). I first thought of using GetPixel/SetPixel to achieve this, but these functions unfortunately use HDCs instead of HBITMAPs. Someone told me that BitBlt would do what I need. But I can't get that much help from the help files, as I don't really know which of the SRCCOPY, SRCAND, ... parameters I have to use (and there's obviously more than one call to BitBlt necessary to map both colors). Can somebody tell me how to map the colors, or even have an example? Thanks, Martin
Technical Details
Message-ID:
<3F9FD04C.5FE8A85E@gmx.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d73ea480b66a6999,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-29 06:40:39 PST Message-ID: <3F9FD04C.5FE8A85E@gmx.de> Date: Wed, 29 Oct 2003 15:35:56 +0100 From: Martin Golm <golm@gmx.de> X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Color mapping of a bitmap Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.156.29.16 X-Trace: newsgroups.borland.com 1067438352 62.156.29.16 (29 Oct 2003 06:39:12 -0700) Lines: 14 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail