3

I have this

BitmapSource  source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(),
IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

How I can use it to apply as source for WPF Image somehow?

Please provide code sample.

Thank you!

H.B.
  • 166,899
  • 29
  • 327
  • 400
NoWar
  • 36,338
  • 80
  • 323
  • 498

1 Answers1

3

BitmapSource derives from ImageSource, so you can assign it directly to the Source property of an Image.

dlev
  • 48,024
  • 5
  • 125
  • 132