Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image vs BitmapImage vs Bitmap

Tags:

c#

image

wpf

I was wondering what the difference is between Image, Bitmap and BitmapImage in WPF & C#.

Can someone help me out?

like image 874
Tom Kerkhove Avatar asked Dec 07 '11 16:12

Tom Kerkhove


People also ask

What is bitmap image in C#?

A Bitmap is an object used to work with images defined by pixel data.


2 Answers

Image is a base abstract class representing images in GDI+. Bitmap is a concrete implementation of this base class.

BitmapImage is a way to represent an image in a vector based GUI engine like WPF and Silverlight. Contrary to a Bitmap, it is not based on GDI+. It is based on the Windows Imaging Component.

There are ways to load a BitmapImage from a Bitmap.

like image 106
Darin Dimitrov Avatar answered Sep 28 '22 00:09

Darin Dimitrov


WinForms/GDI+ uses the abstract class System.Drawing.Image and its implementation Bitmap.

WPF uses the abstract class System.Windows.Media.ImageSource (and BitmapSource) and its implementation BitmapImage.

WPF also has a control named Image, which is a FrameworkElement that contains and displays an ImageSource.

It took me a while to untangle that mess of terminology...

like image 31
Mark Avatar answered Sep 27 '22 23:09

Mark