3

Sorry to ask a question like that but I can't found a good answer :/

What is the difference between BitmapImage and Bitmap?

I want to work with TIFF image with any one of them I have to work. I found some tutorial that works with BitmapImage and another that works with Bitmap.

Akrem
  • 5,033
  • 8
  • 37
  • 64

2 Answers2

12

System.Windows.Media.Imaging.BitmapImage is a specialized BitmapSource that is optimized for loading images using Extensible Application Markup Language (XAML).

System.Drawing.Bitmap is a encapsulates a GDI+ bitmap which consists of the pixel data for a graphics image and its attributes.

The first is used with WPF/Silverlight (XAML), the second is used with Windows Forms (WinForms).

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
  • System.Drawing.Bitmap is not specific to winforms, it can just as easily be used in asp.net, a WCF service, a windows service etc. – Ben Robinson Sep 05 '11 at 13:31
  • 1
    But it's generally used in WinForms. Specially in the context of his question. The MSDN links should clarify the rest. – Claus Jørgensen Sep 05 '11 at 13:32
  • 4
    Sorry but i think it is misleading, it is used for manipulating bitmap images, and is unrelated to winforms, hence the System.Drawing namespace – Ben Robinson Sep 05 '11 at 13:36
  • I disagree. With Silverlight/WPF you would use WriteableBitmap for manipulating bitmap images. So I find System.Drawing to be technology specific. – Claus Jørgensen Sep 05 '11 at 13:42
  • 1
    Bitmap only encapsulates GDI+ native object. GDI+ is not specific to WinForms. BitmapSource uses completely new set of APIs – NoviceProgrammer Sep 05 '11 at 13:54
1

Bitmap is a general purpose class in System.Drawing which can be used to manipulate images. Whereas the BitmapImage class is more geared toward use in the XAML / WPF world.

Sachin
  • 880
  • 6
  • 7