簡體   English   中英

將水印圖像添​​加到圖像

[英]adding a watermark image to an image

我想在我的所有圖像中添加一個小的,漸弱的水印圖像。

有沒有辦法在c#中做到這一點?

您可以使用System.Drawing撰寫圖像

//1. create a bitmap (create a empty one or from file)
Bitmap bmpPic = new Bitmap(imgWidth,imgHeight);

//2. pass that bitmap into Graphics
using (Graphics g = Graphics.FromImage(bmpPic))
{
    //manipulate the image
}

//3. save the bitmap back to a filestream
bmpPic.Save(imgFileStream,ImageFormat.Png);

只需確保處理用作System.Drawing的所有資源使用非托管GDI +資源

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM