代码共享
文章平均质量分 60
mrrightwangl
这个作者很懒,什么都没留下…
展开
-
裁剪图片(方法)
/// /// 裁剪图片/// /// Image 对象/// 裁剪区域/// 新的 Image 图像public static Image Crop(Image image, Rectangle cropArea){ // 定义新图像大小 Bitmap newImage = new Bitmap(cropArea.Width, cropArea.Height); // 创建新的原创 2010-03-25 09:42:00 · 353 阅读 · 1 评论 -
彩色图片转换为灰度图(方法)
private class Consts{ // 根据 NTSC (North America Television Standards Committee) // 规定,红绿蓝值分别为 0.299, 0.587, 0.114时为灰度图 public const float GrayRed = 0.3086f; public const float GrayGreen =原创 2010-03-26 15:46:00 · 1382 阅读 · 1 评论 -
改变图片尺寸(方法)
/// /// 缩放图片/// /// Image 对象/// 图片新的宽度/// 图片新高度/// 是否按比例缩放图片/// Image 对象public static Image Resize(Image image, int width, int height, bool scale){ // 定义图片的新尺寸 int iWidth, iHeight; // 如果是按比原创 2010-03-27 11:15:00 · 690 阅读 · 0 评论