![](/img/trans.png)
[英]How to check the image property of an pictureBox within a form in another form.
[英]Windows Form PictureBox Save Image and Background property
使用按鈕我選擇圖像(相框)並將圖像添加到picturebox.image 屬性使用其他按鈕我選擇照片並將圖像添加到同一個圖片框但添加到picturebox.background
有了另一個按鈕,我創建了一個 .jpg 文件但只保存圖片。圖像需要保存所有..帶有背景的圖像。
你知道我怎樣才能保存帶有背景的圖片嗎? 多謝
聽起來這就是你所追求的那種東西:
using (var compositeImage = new Bitmap(width, height))
using (var g = Graphics.FromImage(compositeImage))
{
g.DrawImage(myPictureBox.BackgroundImage, 0, 0);
g.DrawImage(myPictureBox.Image, 0, 0);
compositeImage.Save(filePath);
}
您需要准確確定合成圖像使用的尺寸以及繪制原始圖像的位置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.