【发布时间】:2012-12-07 02:28:04
【问题描述】:
我知道如何将位图从Load a WPF BitmapImage from a System.Drawing.Bitmap 转换为 BitmapImage
但是当我的位图发生变化时,我想要图像的来源,即BitmapImage会随着位图实时变化,我该怎么做呢?
我生成位图的代码是这样的:
Rectangle rect = new Rectangle(0, 0, 300, 300);
bitmap = new Bitmap(rect.Width, rect.Height);
Graphics g = Graphics.FromImage(bitmap);
DoWithGraphics(g, rect, pictureelements);
DoWithGraphics 是一系列 g.FillRectangle
谢谢!
【问题讨论】:
-
Sooo.. 您想实时查看添加到图像中的每个矩形吗?
-
DoWithGraphics 将填充矩形,我想实时查看矩形。该项目最初是在 WinForm 中实现的,我正在尝试将其更改为 WPF。
标签: wpf bitmap real-time bitmapimage