我想在通用应用程序中使用 x 和 y 裁剪图像, 我搜索了很多但没有找到有用的东西 我的想法是 我有一张图片,我想根据开始 x 、 y - 结束 x 和 y 从中裁剪矩形
我试过了
BitmapImage img = new BitmapImage(new Uri(file.Path));
WriteableBitmap topLeft = img.Crop(0, 0, halfWidth, halfHeight);
它说 BitmapImage 不包含裁剪的定义
另一件事: 如何在通用应用程序中将 BitmapImage 转换为 WriteableBitmap?
最佳答案
您尝试过 BitmapEncoder/BitmapDecoder 类吗?查看MSDN code sample.
关于c# - 裁剪图像通用应用程序 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29604208/