如何用cuteeditor编辑器上传图片的时候加上水印呢?

解决方案 »

  1.   

    上传图片时。。加入水印/// <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();
    }
      

  2.   

    加水印我知道咋加,我想知道的是CuteEditor上传图片时,咋加上水印
      

  3.   

    这篇博客可以帮助到你哦
    http://www.cnblogs.com/sunt2012/archive/2012/12/28/2837274.html