Reading pixels of BitmapSource RRS feed

  • Question

  • Given a bitmapSource, I want to read the pixels natively. As I understand I need to use the CopyPixels call. But understanding the pixels would require the knowledge of Bits per pixel and color Context of the bitmapSource. Though I know the bits per pixel - how do I get to know the color Context.

    The PixelFormat class does not allow me much information - the only way to use PixelFormat, as I percieve, is to compare it with the various static pre-defined values of the PixelFormat. Would that be the most generic way?

    Essentialy, I want to save the bitmapSource in a RAW format. What would be the best way to go about it?


    Monday, September 25, 2006 12:04 PM


  • If you do not specify the BitmapCreateOptions.IgnoreColorProfile, the bits received from CopyPixels already have the color profile applied to it.

    Can you clarify what you mean by "saving the bitmapsource in a RAW format"? Do you just want to take the array of pixels and save it as a binary blob to disk or database?

    Monday, September 25, 2006 3:15 PM