myPictureBox.Image = New Bitmap(myPictureBox.ClientSize.Width, _
myPictureBox.ClientSize.Height)
和
Using g As Graphics = Graphics.FromImage(myPictureBox.Image)
' do the drawing '
End Using
谢谢你的回答。但请告诉我在哪里可以放置此代码。
答案 0 :(得分:0)
OpenFileDialog1.Filter = "Bmp Files(*.bmp)|*.bmp|Gif Files(*.gif)|*.gif|Jpg Files(*.jpg)|*.jpg"
OpenFileDialog1.ShowDialog()
txtEmpPicture.Text = OpenFileDialog1.FileName
PicText.Image = Image.FromFile(OpenFileDialog1.FileName)