图片框图片

时间:2009-09-09 09:11:12

标签: vb.net

myPictureBox.Image =  New Bitmap(myPictureBox.ClientSize.Width, _
                                 myPictureBox.ClientSize.Height)

Using g As Graphics = Graphics.FromImage(myPictureBox.Image)
    ' do the drawing '
End Using
谢谢你的回答。但请告诉我在哪里可以放置此代码。

1 个答案:

答案 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)