We help IT Professionals succeed at work.

TBitmap pointer

paulocbb
paulocbb used Ask the Experts™
on
I've a TBitmap and I want get the pointer of bitmap buffer...

How can I get this ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012

Commented:
What exactly are you trying to do? The TBitmap has a Canvas property. From there you can directly access and modify the image data.

Author

Commented:
I'm using a lib to analyses a bitmap and I need give the pointer of bmp stream ...
I've a TBitmap ... how can I get this pointer with cool performance?

Without use TMemoryStream ...

Is possible?
Oracle dba
Top Expert 2009
Commented:
you can get a pointer to the first scanline

p := bitmap.ScanLine[0];

are you sure you don't need to pass the handle of the bitmap ?
>> bitmap.Handle;
Commented:
Have a look at API function GetDiBits, which copies a bitmap into a buffer referenced by a pointer...

GetDIBits function
GetDIBits vs. Scanline vs. Pixels[] in Delphi Bitmaps
GetDIBits, SetDIBits, BitBlt