Load a WPF BitmapImage from a System.Drawing.Bitmap

前端 未结 10 2227
天涯浪人
天涯浪人 2020-11-22 04:39

I have an instance of a System.Drawing.Bitmap and would like to make it available to my WPF app in the form of a System.Windows.Media.Imaging.BitmapImage<

10条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 05:11

    The easiest thing is if you can make the WPF bitmap from a file directly.

    Otherwise you will have to use System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap.

提交回复
热议问题