Tono Nam
Tono Nam

Reputation: 36048

display a System.Drawing.Bitmap object in a System.Windows.Controls.Image control

I have an image control as:

<Image Height="209" HorizontalAlignment="Left" Margin="66,74,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" />

in a wpf application. I imported a library that converts a video to bitmap images and I am trying to place those bitmaps in the image countrol. There is a method that returns a System.Drawing.Bitmap object and I want to display that bitmap in image1. How could I do that?

Upvotes: 3

Views: 8798

Answers (1)

brunnerh
brunnerh

Reputation: 184296

You need to convert it to an ImageSource of some kind first. See this question.

You can use a ValueConverter to do this on the fly in the binding itself.

Upvotes: 2

Related Questions