tags:

views:

105

answers:

1

Hi there,

I need to perform the convertion RenderTargetBitmap -> BitmapImage. What is the way to do that?

Thank you in advance!

Cheers

+1  A: 

BitmapImage and RenderTargetBitmap both inherit directly from BitmapSource. The functionality that BitmapImage supplies over BitmapSource is just for ease of loading from an URI. I can't think of any scenario where you would need a BitmapImage rather than a BitmapSource (which RenderTargetBitmap already is) after you already have the image loaded / rendered.

What specifically are you trying to do?

Martin Harris
I need to combine two images, jpg and png and then use the resulting bitmap
Jamie
Which method / class are you trying to use to do this that only takes in an BitmapImage and not a BitmapSource? I guess if you really need to you could save the resultant bitmap out to a temp file and load it back in, but I don't think you will be able to go directly from RenderTargetBitmap to BitmapImage since a BitmapImage requires a file to load from.
Martin Harris
Well, I have got two BitmapImages and I uses Grid to combine them. Finally, RenderTargetBitmap renders this Grid, thus I need to go from RTB to BitmapImage again. Do you have any other idea?
Jamie
Sorry, I guess I'm still not understanding. You say "thus I need to go from RTB to BitmapImage again", but for what? What are you trying to do with the BitmapImage that you can't do directly on the RTB?
Martin Harris