PictureBox,Image,Graphics,DC之间是什么关系?
一直不明白PictureBox,Image,Graphics,DC它们到底指的是什么?
DC与内存DC又是什么?
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bp As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim gr As Graphics = Graphics.FromImage(bp)
gr.DrawString("Hello World", Me.Font, Brushes.Red, 20, 33)
bp.Save("D:\1.bmp")
gr.Dispose()
bp.Dispose()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bp As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim gr As Graphics = Graphics.FromImage(bp)
gr.DrawString("Hello World", Me.Font, Brushes.Red, 20, 33)
PictureBox1.Image = bp '增加此句
bp.Save("D:\1.bmp")
gr.Dispose()
bp.Dispose()
End Sub