I am working on application for Windows Mobile 6.1. device that, at some point, displays images. However from time to time i run into the limits of RAM when doing it.
I was using the recipe from http://blog.opennetcf.com/ctacke/2010/10/13/LoadingPartsOfLargeImagesInTheCompactFramework.aspx, but in the end, it didn't provide me with solution. To be more specific, in CreateClip the whole image is read in
GetFactory().CreateBitmapFromImage(image, info.Width, info.Height,
info.PixelFormat, InterpolationHint.InterpolationHintDefault, out original);
which is where i recieve OutOfMemoryException.
The question is, how can just a specific area be read, with the rest of image discarded and not saved in memory? Image format i am using is png.
Closest thing to what i need is png_read_row from libpng, since it allows, using a one-row buffer, discard all unneede rows and extract parts of rows that are actually needed into result buffer. Is that valid way of using it? How can that be done?