What is the void* returned from CGBitmapContextGetData?

I'm trying to get the pixel information from an image and have got to the point where I have my void* data object which is a pointer to the image data.

What exactly is this object? I've tried iterating over it hoping that it's an array of pixel info but it doesn't seem to work.

I want to get the rgb values for each pixel.


It's a pointer to the bitmap data. If you're having trouble interpreting it, then the bitmap probably isn't in the format you think it's in (CoreGraphics does some conversions automatically on loading external bitmaps).

Check the bitmap format info with CGBitmapContextGetBitmapInfo().

Need Your Help

Trouble calling SystemParametersInfo

c# .net windows winapi pinvoke

Recently I've been trying to call the SystemParametersInfo method from managed code, without any success.

c# How can I make my gif animation loop in a picturebox

c# picturebox

I have imported an animated GIF as a resource into a picturebox - unfortunitly it only plays to the end frame and never repeats. Id there something I could do to make it loop continiously. The gif ...