想做一个图片处理的程序 想做一个图片处理的程序,是客户端的,客户可以添加照片,然后修改照片,还可以添加模板,写字,放背景等各种特效的,类似现在的网上好多打印照片的网站,用c#能做吗,用c#的什么技术呢?或者有没有c#现成的,开放源码的让下载研究呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个还是用VC吧,主要是很多图像库都是用C++写的,比如opencv做这个就很方便,但是用C#调用太麻烦了 使用JS实现图片处理http://topic.csdn.net/u/20090420/00/4042e404-e802-45f7-8b25-c7fbc5a81c76.html 《GDI+ 程序设计》 清华大学出版社出版的 Eric White view plaincopy to clipboardprint?/// <summary> /// Resize图片 /// </summary> /// <param name="bmp">原始Bitmap</param> /// <param name="newW">新的宽度</param> /// <param name="newH">新的高度</param> /// <param name="Mode">保留着,暂时未用</param> /// <returns>处理以后的图片</returns> public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH, int Mode) { try { Bitmap b = new Bitmap(newW, newH); Graphics g = Graphics.FromImage(b); // 插值算法的质量 g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel); g.Dispose(); return b; } catch { return null; } } ========================== /// <summary> /// 剪裁 -- 用GDI+ /// </summary> /// <param name="b">原始Bitmap</param> /// <param name="StartX">开始坐标X</param> /// <param name="StartY">开始坐标Y</param> /// <param name="iWidth">宽度</param> /// <param name="iHeight">高度</param> /// <returns>剪裁后的Bitmap</returns> public static Bitmap KiCut(Bitmap b, int StartX, int StartY, int iWidth, int iHeight) { if (b == null) { return null; } int w = b.Width; int h = b.Height; if (StartX >= w || StartY >= h) { return null; } if (StartX + iWidth > w) { iWidth = w - StartX; } if (StartY + iHeight > h) { iHeight = h - StartY; } try { Bitmap bmpOut = new Bitmap(iWidth, iHeight, PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(bmpOut); g.DrawImage(b, new Rectangle(0, 0, iWidth, iHeight), new Rectangle(StartX, StartY, iWidth, iHeight), GraphicsUnit.Pixel); g.Dispose(); return bmpOut; } catch { return null; } } c# unsafe中fixed的用法 如何让C#可以提交表单? C#winform关于textbox智能提示问题 config文件的问题,帮我看一下。 高手看看,这个有问题吗 使用FileUpload控件的问题 问下.net下面,哪种语言现在市场上用得最多? 小白求C#实现 系统托盘 代码,在线等 哪个控件可以选择目录.OpenFileDialog,好象只能选择文件 怎么在C#中选择Excel中的列 不停刷新控制内容,如何实现? C语言新手求教一个语法错误
http://topic.csdn.net/u/20090420/00/4042e404-e802-45f7-8b25-c7fbc5a81c76.html
清华大学出版社出版的
Eric White
/// <summary>
/// Resize图片
/// </summary>
/// <param name="bmp">原始Bitmap</param>
/// <param name="newW">新的宽度</param>
/// <param name="newH">新的高度</param>
/// <param name="Mode">保留着,暂时未用</param>
/// <returns>处理以后的图片</returns>
public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH, int Mode)
{
try
{
Bitmap b = new Bitmap(newW, newH);
Graphics g = Graphics.FromImage(b);
// 插值算法的质量
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
g.Dispose();
return b;
}
catch
{
return null;
}
}
==========================
/// <summary>
/// 剪裁 -- 用GDI+
/// </summary>
/// <param name="b">原始Bitmap</param>
/// <param name="StartX">开始坐标X</param>
/// <param name="StartY">开始坐标Y</param>
/// <param name="iWidth">宽度</param>
/// <param name="iHeight">高度</param>
/// <returns>剪裁后的Bitmap</returns>
public static Bitmap KiCut(Bitmap b, int StartX, int StartY, int iWidth, int iHeight)
{
if (b == null)
{
return null;
}
int w = b.Width;
int h = b.Height;
if (StartX >= w || StartY >= h)
{
return null;
}
if (StartX + iWidth > w)
{
iWidth = w - StartX;
}
if (StartY + iHeight > h)
{
iHeight = h - StartY;
}
try
{
Bitmap bmpOut = new Bitmap(iWidth, iHeight, PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(bmpOut);
g.DrawImage(b, new Rectangle(0, 0, iWidth, iHeight), new Rectangle(StartX, StartY, iWidth, iHeight), GraphicsUnit.Pixel);
g.Dispose();
return bmpOut;
}
catch
{
return null;
}
}