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
Asked
Active
Viewed 1.0k times
5
-
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 Answers
12
A BitmapImage inherits from BitmapSource so no conversion is needed

parapura rajkumar
- 24,045
- 1
- 55
- 85
-
If I write ImageFrame im = ImageFrame.Create(bitmapImage); this cause error – curiousity Nov 15 '11 at 15:25
-
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