Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetDIBits - question

Status
Not open for further replies.

CaffeineCoder

Programmer
Mar 5, 2004
1
DE
Hi Everybody,

I've got to adjust a program, that works under Win2k and WinXP so far, so that it will work under Win98 as well. Another component (GhostScript) calls the following function, with a Bitmap as parameter:

// Copy the information from the image record to the bitmap object
function copy_image(bm: TBitmap): boolean;
var BitmapInf: BITMAPINFO;
Bitmap: HBitmap;

begin
bm.Height := image.bmih.biHeight;
bm.Width := image.bmih.biWidth;
bm.IgnorePalette := true;

Bitmap := bm.Handle;
BitmapInf.bmiHeader := image.bmih;

if SetDIBits(0, Bitmap, 0, image.bmih.biHeight, image.image, BitmapInf, DIB_RGB_COLORS) > 0 then
result := true
else
result := false;
end;

I suppose that s.th. is wrong with the function SetDIBits, since the Data in the bm object is correct. It works correctly under Win2k and XP, but under Win98, the result is a blank screen. Do you have any idea, what I have to do differently when calling the SetDIBits function?

Your help will be appreciated a lot

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top