asp.Net生成画像と画像透かし

990 ワード

詳細

    /// 
    ///       
    /// 
    ///      
    ///      
    ///       
    public void AddShuiYinPic(string Path, string Path_syp, string Path_sypf)
    {
    //    
    System.Drawing.Image image = System.Drawing.Image.FromFile(Path);
    //    
    System.Drawing.Image copyImage =System.Drawing.Image.FromFile(Path_sypf);
    //     
    System.Drawing.Graphics g =System.Drawing.Graphics.FromImage(image);
    //        
    g.DrawImage(copyImage, new System.Drawing.Rectangle(image.Width-copyImage.Width, image.Height -copyImage.Height, copyImage.Width,copyImage.Height), 0, 0, copyImage.Width,copyImage.Height, System.Drawing.GraphicsUnit.Pixel);
    g.Dispose();
    image.Save(Path_syp);
    copyImage.Dispose();
    image.Dispose();
    }