当用户发一张图片后,我在该图片的右下角自动加上我们网站的logo标志

解决方案 »

  1.   

    注意:在asp.net中,文件名要用虚拟路径,如:Server.MapPath("/test/test.jpg");/// <summary>
    /// 在图片上加入图片版权信息
    /// </summary>
    /// <param name="fileName"><seealso cref="原始图片"/></param>
    /// <param name="copyRightFile"><seealso cref="版权图片"/></param>
    /// <param name="outfileName"><seealso cref="输出图片"/></param>
    /// <param name="deleteFile"><seealso cref="是否删除原始图片"/></param>
    /// <param name="overrideOld"><seealso cref="如果图片存在是否覆盖"/></param>
    /// <param name="x"><seealso cref="版权图片显示的X轴坐标"/></param>
    /// <param name="y"><seealso cref="版权图片显示的Y轴坐标"/></param>
    public void createCopyRightImage(string fileName, string copyRightFile, string outfileName, bool deleteFile, bool overrideOld, float x, float y)
    {
    System.Drawing.Image image  = System.Drawing.Image.FromFile(fileName);
    System.Drawing.Image c_image = System.Drawing.Image.FromFile(copyRightFile);
    System.Drawing.Bitmap outPut = new System.Drawing.Bitmap(image);
    System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(outPut);
    g.DrawImage(c_image, x, y);

    if(System.IO.File.Exists(outfileName))
    {
    if(overrideOld)
    {
    System.IO.File.Delete(outfileName);
    outPut.Save(outfileName, System.Drawing.Imaging.ImageFormat.Jpeg);
    }
    }
    else
    {
    outPut.Save(outfileName, System.Drawing.Imaging.ImageFormat.Jpeg);
    }

    g.Dispose();
    outPut.Dispose();
    image.Dispose();
    c_image.Dispose();
    if(deleteFile)
    {
    System.IO.File.Delete(fileName);
    }
    }
      

  2.   

    http://www.google.com中搜索"上传图片 水印"
      

  3.   


    http://www.aspxboy.com/Files/71/66/218.Aspx
      

  4.   

    使用 GDI 对图像处理了