我知道如何从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
谢谢!