public static BitmapSource ToBitmapSource(Bitmap bitmap)
{
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, ImageFormat.Png);
ms.Position = 0;
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.StreamSource = ms;
bi.EndInit();
return bi;
}
将System.Drawing.Bitmap转换成System.Drawing.Imaging.BitmapSource
最新推荐文章于 2024-02-04 00:30:00 发布