2013-05-13 32 views
1

我正在尋找一種方法來製作水印加法器。 這個想法是,它使用打開的文件對話框加載圖片,然後在圖片上或下面添加水印! 。我正在尋找這是否可能以某種方式 這是我的代碼,但我總是和錯誤Visual basicWatermark加法器

Dim Image1 As New Bitmap(OpenFileDialog1.FileName) 
Dim Image2 As New Bitmap(PictureBox3.Image) 

Dim Result As New Bitmap(Math.Max(Image1.Width, Image2.Width), _ 
    Image1.Height + Image2.Height) 
Dim gResult As Graphics = Graphics.FromImage(Result) 
gResult.DrawImage(Image1, New Point(0, 0)) 
gResult.DrawImage(Image2, New Point(0, Image1.Height)) 
gResult.Dispose() 
gResult = Nothing 
picturebox1.load(gresult) or picturebox1.load(result) 

我得到的錯誤與他們兩個!

+0

你搜索什麼?這裏有很多解決方案,https://www.google.co.uk/search?q=vb.net+add+watermark+to+image&aq=1&oq=vb+.net+add+wat&aqs=chrome.2.57j0l3j62.8920j0&sourceid = chrome&ie = UTF-8,我假設這是vb.net btw。 – 2013-05-13 15:41:47

+0

您可以將您的請求改爲一個問題嗎?我不確定你在問什麼。 – Jules 2013-05-13 15:42:23

+0

什麼是錯誤?最後一行出現 – 2013-05-13 15:58:29

回答

1

picturebox1.Load(...)是用於路徑字符串,而不是圖像或圖形。

嘗試使用

picturebox1.Image = Result 
相關問題