Load a WPF BitmapImage from a System.Drawing.Bitmap

前端 未结 10 2168
天涯浪人
天涯浪人 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:24

    I work at an imaging vendor and wrote an adapter for WPF to our image format which is similar to a System.Drawing.Bitmap.

    I wrote this KB to explain it to our customers:

    http://www.atalasoft.com/kb/article.aspx?id=10156

    And there is code there that does it. You need to replace AtalaImage with Bitmap and do the equivalent thing that we are doing -- it should be pretty straightforward.

提交回复
热议问题