将System.Windows.Controls.Image的BitmapSource转换为System.Drawing.Bitmap

很容易将System.Windows.Controls.Image的BitmapSource设置为System.Drawing.Bitmap类型的变量,但如何将将System.Windows.Controls.Image的BitmapSource转换为System.Drawing.Bitmap的问题让我郁闷了半天,终于在网上找到了一个方法,虽然笨了点,不过总算实现了转换。不知道还有没有更好的方法,以后再研究研究。

Code

需要更改工程的属性,在工程属性\"生成" 选中 “允许不安全代码”

posted @ 2009-05-27 16:37  乔治国  阅读(3738)  评论(0编辑  收藏  举报