프로그래밍언어/VB.NET

바탕화면에 이미지 그리기

부산딸랑이 2013. 9. 3. 05:03



Imports System.Drawing

Imports System.Drawing.Drawing2D

Imports System.Windows.Forms

Public Class Form1

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

Dim G As System.Drawing.Graphics = Graphics.FromHwnd(Me.Handle) ' 핸들입력

Dim points(3) As System.Drawing.Point

points(0) = New Point(120, 60) 'Top Left of Trapezoid

points(1) = New Point(180, 60) 'Top Right of Trapezoid

points(2) = New Point(240, 120) 'Bottom Right of Trapezoid

points(3) = New Point(60, 120) 'Bottom Left of Trapezoi

G.DrawPolygon(New Pen(Color.Blue), points)

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

 

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen

End Sub

End Class

Public Class GraphicsFromHwnd

Public Shared Sub Main()

Application.Run(New Form1)

End Sub

End Class

'프로그래밍언어 > VB.NET' 카테고리의 다른 글

비주얼스튜디오2012 최근항목 제거  (0) 2013.09.08
화면 우측하단에 띄우기  (0) 2013.09.04
화면위에 이미지그리기  (0) 2013.09.02
VB.NET 프로시저 유형  (0) 2013.09.01
VB.NET사각형 그리기  (0) 2013.09.01