我尝试向图片添加文字然后保存。以下实际上保存了图像,但是当我尝试打开它时,它表示它不是有效的格式。它被保存为'礼品券'没有.png扩展名。任何帮助表示赞赏..
Dim newimage As bitmap
newimage = system.drawing.Image.FromFile(server.mappath("files/images/gift-voucher.png"))
Dim gr As Graphics = Graphics.FromImage(newimage)
Dim myFontLabels as New Font("Arial", 10)
Dim myBrushLabels As New SolidBrush(Color.White)
gr.DrawString("SOLD",myFontLabels, myBrushLabels,10, 190)
newimage.Save("C:\Inetpub\vhosts\onlinecarbooty.com\httpdocs\catalog\images\gift-voucher", System.Drawing.Imaging.ImageFormat.png)
newimage.Dispose()