cuteeditor图片水印问题 如何用cuteeditor编辑器上传图片的时候加上水印呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 上传图片时。。加入水印/// <summary>/// 对一个指定的图片加上图片水印效果。/// </summary>/// <param name="imageFile">图片文件地址</param>/// <param name="waterImage">水印图片(Image对象)</param>public static void CreateImageWaterMark(string imageFile, System.Drawing.Image waterImage){ if (string.IsNullOrEmpty(imageFile) || !File.Exists(imageFile) || waterImage == null) { return; } System.Drawing.Image originalImage = System.Drawing.Image.FromFile(imageFile); if (originalImage.Width - 10 < waterImage.Width || originalImage.Height - 10 < waterImage.Height) { return; } Graphics graphics = Graphics.FromImage(originalImage); int x = originalImage.Width - waterImage.Width - 10; int y = originalImage.Height - waterImage.Height - 10; int width = waterImage.Width; int height = waterImage.Height; graphics.DrawImage(waterImage, new Rectangle(x, y, width, height), 0, 0, width, height, GraphicsUnit.Pixel); graphics.Dispose(); MemoryStream stream = new MemoryStream(); originalImage.Save(stream, ImageFormat.Jpeg); originalImage.Dispose(); System.Drawing.Image imageWithWater = System.Drawing.Image.FromStream(stream); imageWithWater.Save(imageFile); imageWithWater.Dispose();} 加水印我知道咋加,我想知道的是CuteEditor上传图片时,咋加上水印 这篇博客可以帮助到你哦http://www.cnblogs.com/sunt2012/archive/2012/12/28/2837274.html 求一个用户登录的思路 求 js调用button事件代码??? 还是lucene.net的问题 asp.net 保存word问题 ASP.NET 域名问题 ajax timer显示倒计时时间 简单的问题 SqlDataSource的UpdateCommand参数怎么使用变量? cache、dataset、Dataview相互影响的问题 asp.net中数据更新问题~~ 怎么判断用户输入的是不是时:分:秒格式 如何避免注册机批量注册会员
/// 对一个指定的图片加上图片水印效果。
/// </summary>
/// <param name="imageFile">图片文件地址</param>
/// <param name="waterImage">水印图片(Image对象)</param>
public static void CreateImageWaterMark(string imageFile, System.Drawing.Image waterImage)
{
if (string.IsNullOrEmpty(imageFile) || !File.Exists(imageFile) || waterImage == null)
{
return;
} System.Drawing.Image originalImage = System.Drawing.Image.FromFile(imageFile); if (originalImage.Width - 10 < waterImage.Width || originalImage.Height - 10 < waterImage.Height)
{
return;
} Graphics graphics = Graphics.FromImage(originalImage); int x = originalImage.Width - waterImage.Width - 10;
int y = originalImage.Height - waterImage.Height - 10;
int width = waterImage.Width;
int height = waterImage.Height; graphics.DrawImage(waterImage, new Rectangle(x, y, width, height), 0, 0, width, height, GraphicsUnit.Pixel);
graphics.Dispose(); MemoryStream stream = new MemoryStream();
originalImage.Save(stream, ImageFormat.Jpeg);
originalImage.Dispose(); System.Drawing.Image imageWithWater = System.Drawing.Image.FromStream(stream); imageWithWater.Save(imageFile);
imageWithWater.Dispose();
}
http://www.cnblogs.com/sunt2012/archive/2012/12/28/2837274.html