5

How to get BitmapSource from BitmapImage? Or how to convert BitmapImage to BitmapFrame directly? It seems to me that if I have BitmapSource I could use BitmapFrame.Create and finally get BitmapFrame object from given BitmapImage

curiousity
  • 4,703
  • 8
  • 39
  • 59
  • possible duplicate of [Difference between a BitmapFrame and BitmapImage in WPF](http://stackoverflow.com/questions/155391/difference-between-a-bitmapframe-and-bitmapimage-in-wpf) – CodeCaster Nov 15 '11 at 15:21

2 Answers2

12

A BitmapImage inherits from BitmapSource so no conversion is needed

parapura rajkumar
  • 24,045
  • 1
  • 55
  • 85
1

The BitmapImage inherits from BitmapSource as parapura said.

Example:

BitmapSource bitmapSource = new BitmapImage();
BitmapImage bitmapImage = bitmapSource as BitmapImage;

Source: BitmapSource MSDN

AzzamAziz
  • 2,144
  • 1
  • 24
  • 34