🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to BitBlt a 256 color bitmap?

#2806
From: Kevin Owen
Date: Wed, 22 May 1991 23:54
30 lines
1721 bytes
How can I manipulate (Blt) a 256 color bitmap that was loaded as a resource?

I have successfully loaded and Blt'ed several 16 color bitmaps using
the following piece of code.  When I attempt to do the same with a
256 color bitmap it gets rendered in 16 colors.  I can read the 256
color image into PaintBrush and it looks fine.  

    MemoryDC = CreateCompatibleDC(hDC);
    SelectObject(MemoryDC, h_bitmap);
    GetObject(h_bitmap, sizeof(BITMAP), (LPSTR) &bm);
    width = bm.bmWidth;
    height = bm.bmHeight;
    BitBlt(hDC, xpos, ypos, width, height, MemoryDC, 0, 0, SRCCOPY);
    DeleteDC(MemoryDC);

I am using a 34020 based video adapter (HP IGC-20) running in 
1024x768x256 colors.

Perhaps I need to do something to load the correct palette?
Or should Windows be doing that for me?

Any ideas (or snippits of code) would be greatly appreciated.

_______________________________________________________________________________

 _   ,                   __                 Kevin Owen @ Hewlett-Packard
' ) /                   / ')                Sunnyvale, California
 /-<   _ , __o  ____   /  / , , , _  ____   Phone :    (408) 720-3845
/   ) </_\/ <__/ / <  (__/ (_(_/_</_/ / <_  UN*X Mail  ...hplabs!hpcc01!kevino
_______________________________________________________________________________
Technical Details
Message-ID: <24650004@hpcc01.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpcc05!hpcc01!kevino

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpcc05!hpcc01!kevino
From: kevino@hpcc01.HP.COM (Kevin Owen)
Newsgroups: comp.windows.ms.programmer
Subject: How to BitBlt a 256 color bitmap?
Message-ID: <24650004@hpcc01.HP.COM>
Date: 22 May 91 23:54:51 GMT
Organization: HP Corp Computing & Services
Lines: 30