CaffeineCoder
Programmer
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
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