Skip to content

Instantly share code, notes, and snippets.

@hellboy81
Created October 18, 2013 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellboy81/1d111e260a897db79aa1 to your computer and use it in GitHub Desktop.
Save hellboy81/1d111e260a897db79aa1 to your computer and use it in GitHub Desktop.
In WinCE device should always 24 bit images used?
// image : 32 Bit
image.GetImageInfo(out imageInfo);
// imageInfo.PixelFormat = PixelFormat.Format32bppRgb detected
// Without this line thumbnail is black image
imageInfo.PixelFormat = PixelFormat.Format24bppRgb;
// http://msdn.microsoft.com/en-us/library/aa452205.aspx
// A PixelFormatID value that specifies the numerical format of the pixels in the image.
// For more information, see PixelFormat Values.
// Set this value to PixelFormatDontCare to create a new bitmap image that has the same pixel format as the source image.
IImagingFactory.CreateBitmapFromImage(image, (uint)width, (uint)height,
imageInfo.PixelFormat, InterpolationHint.InterpolationHintDefault, out thumbnail);
// thumbnail is now correct both for 24-Bit and 32-Bit images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment