views:

44

answers:

1

Hi there,

I need to get the BitmapImage from the byte array. Currently I'm working with MemoryStream (byte[] -> MemoryStream -> BitmapImage) but it seems to be not efficient. The same situation in the other way round - I need to get the byte array representing the BitmapFrame. Again, I'm doing that with MemoryStream.

What is the most efficient way to accomplish that task? Is it possible to speedup the conversion?

Thank you in advance for the replies and hints!

Cheers

A: 

Im using BitmapSource.CopyPixels to extract the bytes from the BitmapSource and then BitmapSource.Create to create a new image from the byte array.

I'm not sure how effective it is though, but it is sufficient for my purposes (I can extract the pixels, recolor them and then paste them back on a 2000*2000 image with barely noticeable delay).

CommanderZ
I will check it if it does speedup the processing...
Jamie