【发布时间】:2019-12-07 18:03:56
【问题描述】:
我正在画布上工作并在其上加载图像。如何将图像的分辨率设置为 640X480 像素? decodepixelheight 和 decodepixelwidth 不起作用。
ImageBrush brush = new ImageBrush();
BitmapImage src = new BitmapImage(new Uri(("C:\\Users\\i2v\\Desktop\\GoogleMapTA.jpg"), UriKind.Relative));
src.DecodePixelHeight = 480;
src.DecodePixelWidth = 640;
brush.ImageSource = src;
// brush.Stretch = Stretch.None;
canvas.Background = brush;
canvas.Height = src.Height;
canvas.Width = src.Width;
【问题讨论】:
标签: c# wpf image canvas drawing