vb.net Bitmap Drawing

页面导航:首页 > 软件编程 > vb.net > vb.net Bitmap Drawing

vb.net Bitmap Drawing

来源: 作者: 时间:2016-01-15 15:10 【

Public Class Form1Dim BMP As New Drawing.Bitmap(640, 480)Dim GFX As Graphics = Graphics.FromImage(BMP)Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Syste...
Public Class Form1
	Dim BMP As New Drawing.Bitmap(640, 480)
	Dim GFX As Graphics = Graphics.FromImage(BMP)
	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		FX.FillRectangle(Brushes.White, 0, 0, PictureBox1.Width, PictureBox1.Height)
		GFX.DrawLine(Pens.Red, 10, 10, 50, 50)
		GFX.DrawString("Robomatics", SystemFonts.DefaultFont, Brushes.Black, 60, 60)
		PictureBox1.Image = BMP
	End Sub
	Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
		BMP.SetPixel(MousePosition.X - Me.Location.X - PictureBox1.Location.X - 4, MousePosition.Y - Me.Location.Y - PictureBox1.Location.Y - 30, Color.Black)
		GFX.DrawString("Robomatics", SystemFonts.DefaultFont, Brushes.Black, MousePosition.X - Me.Location.X - PictureBox1.Location.X - 4, MousePosition.Y - 	Me.Location.Y - PictureBox1.Location.Y - 30)
		PictureBox1.Image = BMP
	End Sub
End Class

 

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<