• Advertisement
Sign in to follow this  

FreeImage - bitmap from memory C++

This topic is 2467 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Basically, in a nutshell, I have an archive of resources (not a standard archive, one I wrote myself). Let's say for example I pull a .png file out of that archive and into a char array. So, the ENTIRE image file is in that array, including the header. I need to get the image data into a dib. I looked around and found this function:

[source]FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));[/source]

Could I use this to get what I need? For example...


Assume that fif, io and image are declared and initialized. image is the char array of image data.
[source]
FIBITMAP* dib = FreeImage_LoadFromHandle(fif, &io, (fi_handle)image, 0);
unsigned char * bits = FreeImage_GetBits(dib);
[/source]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement