using XAML to bind to a System.Drawing.Image into a System.Windows.Image control

后端 未结 2 1483
天涯浪人
天涯浪人 2020-12-08 23:17

I\'m binding a ListView to a list of objects, like so;



        
2条回答
  •  不思量自难忘°
    2020-12-08 23:39

    You can't bind that directly - you need to have some type of converter that will convert from a GDI Image to a WPF Image.

    Here is one approach - it uses a memory stream to pull the data from the GDI image and create a BitmapSource object.

提交回复
热议问题