使用MVC3/WebMatrix发布的WebImage。从文件路径加载以下图像:
- 或者 -
对其运行以下代码:
return new WebImage(path)
.Resize(120, 265)
.GetBytes("Png");
将图像中的透明度去除,并使用黑色代替:
return new WebImage(path)
.GetBytes("Png");
图像被成功返回。
使用MVC3/WebMatrix发布的WebImage。从文件路径加载以下图像:
- 或者 -
对其运行以下代码:
return new WebImage(path)
.Resize(120, 265)
.GetBytes("Png");
return new WebImage(path)
.GetBytes("Png");
Write()
而不是GetBytes()
吗?Write()
在幕后不幸地调用了 GetBytes()
。 - Chris Haas