使用VB.NET的PictureBox控件,将图片加载到PictureBox中,然后可以对图片进行编辑和保存。
代码示例:
'加载图片 PictureBox1.Image = Image.FromFile("C:\picture.jpg")
'编辑图片 Dim g As Graphics = Graphics.FromImage(PictureBox1.Image) g.DrawString("Hello World", New Font("Arial", 16), Brushes.Black, New PointF(0, 0)) PictureBox1.Refresh()
'保存图片 Dim fileName As String = "C:\edited_picture.jpg" PictureBox1.Image.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg)
上一篇:编辑布尔值返回默认值