NoWar
NoWar

Reputation: 37633

BitmapSource as source to Image Control

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!

Upvotes: 3

Views: 3718

Answers (1)

dlev
dlev

Reputation: 48596

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

Upvotes: 3

Related Questions