Retrieve the image buffer

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imagetester

Retrieve the image buffer

Post by imagetester »

Is their any way to retrieve the image buffer ( data )after reading it ?! In other words i need the unsigned char* of the image.

Image im;
im.read("test.bmp");

unsigned char * buf;

buf=?!

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Retrieve the image buffer

Post by magick »

Try writePixels():
  • // Transfers one or more pixel components from the image pixel
    // cache to a buffer or file.
    // Used to support image encoders.
    void Magick::Image::writePixels ( const Magick::QuantumType quantum_,
    unsigned char *destination_ )
Post Reply