7
在GDI +的WinForms,我会做:如何在WPF中直接绘制位图(BitmapSource,WriteableBitmap)?
Bitmap b = new Bitmap(32,32);
Graphics g = Graphics.FromImage(b);
//some graphics code...`
如何做同样的事情在WPF,用的DrawingContext?
在GDI +的WinForms,我会做:如何在WPF中直接绘制位图(BitmapSource,WriteableBitmap)?
Bitmap b = new Bitmap(32,32);
Graphics g = Graphics.FromImage(b);
//some graphics code...`
如何做同样的事情在WPF,用的DrawingContext?
您可以使用RenderTargetBitmap将任何WPF内容呈现为位图,因为它本身是BitmapSource
。有了这个,你可以使用standard drawing operations in WPF来“绘制”一个位图。