Page 1 of 1

Convert a JPG to RGB array from a handle in memory

Posted: 2008-04-10T09:43:59-07:00
by jeffcraighead
I just want to know if this is possible and which function to call to do it if so. I've got a stream of JPGs from an image server that broadcasts on a multicast address. I want to use IMs C API to convert the JPG images which are in memory to RGB arrays for use in a larger .NET application by wrapping the necessary API function calls.

Thanks!

Re: Convert a JPG to RGB array from a handle in memory

Posted: 2008-04-10T09:47:18-07:00
by magick
MagickCore provides BlobToImage() which accept in-memory image formats. You can then extract pixels with AcquireImagePixels() or ExportQuantumPixels(). There should be analogs to these methods in the other ImageMagick progamming interfaces (e.g. MagickWand, Magick++, etc.).

Re: Convert a JPG to RGB array from a handle in memory

Posted: 2008-04-10T10:13:52-07:00
by jeffcraighead
Thanks, that's just what I was hoping for.