
Getbitmapbits or how to get a pointer
Hey,
I've got a highspeed procedure, that allows to copy a bitmap
into a WingDC very fast. This procedure needs a pointer on
the bitmap bits to work. I created a bitmap in the memory,
the problem is: I've got a handle on the bitmap but no pointer.
I tried to get a pointer with getobject and getbitmapbits
(see listing below). It doesn't work, the program always crash.
Can anyone help me or has anybody a better way to get a pointer?
var
tempdc,memdc : HDC;
nummer : TBitmap;
number,old : HBitmap;
picture : pointer;
begin
tempdc := createdc('Display',nil,nil,nil);
number := createcompatiblebitmap(tempdc,40,40);
memdc := createcompatibledc(tempdc);
old := selectobject(memdc,number);
textout(memdc,1,1,'ALloha',6);
getbitmapbits(number,nummer.bmwidth*nummer.bmheight,picture);
putsprite(0,PWingbitmap,picture,39,39,500,
40,0); {highspeed assembler procedure}
release.......
....
end;
Thanks for reading, hope you can help me.
--
Markus Joschko