일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- graphene-django
- numpy
- SQL
- array
- GraphQL
- FastAPI
- for loop
- Django
- Django-allauth
- allauth
- tkinter Radio 동적버튼
- check_password
- python
- flask
- Today
- Total
객
[ vb 2008] DrawArc 예제. 본문
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Drawing.Graphics
Public Class DrawArc
' 프로그램명 : 원 그리기
' 제작일 : 2010. 01. 08
' 제작자 : 객과 함께.
Dim RcDraw As Rectangle
Dim Rc As New Rectangle
Dim startAngle As Integer = 45
Dim sweepAngle As Integer = 360
Private Sub Form3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
RcDraw.X = e.X
RcDraw.Y = e.Y
End Sub
Private Sub Form3_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
If e.X < RcDraw.X Then
Rc.Width = RcDraw.X - e.X
RcDraw.X = e.X
Else
Rc.Width = e.X - RcDraw.X
End If
If e.Y < RcDraw.Y Then
Rc.Height = RcDraw.Y - e.Y
RcDraw.Y = e.Y
Else
Rc.Height = e.Y - RcDraw.Y
End If
If Rc.Width = 0 And Rc.Height = 0 Then Exit Sub
Form3Paint()
End Sub
Private Sub Form3Paint()
Dim redPen As New Pen(Color.Red, 1)
Dim G As Graphics = Me.CreateGraphics()
G.DrawArc(redPen, RcDraw.X, RcDraw.Y, Rc.Width, Rc.Height, startAngle, sweepAngle)
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
Me.Text = " DrawArc 예제 "
End Sub
End Class
[ 실행 화면 ]
'[PL] > VB & VB.NET' 카테고리의 다른 글
[ VB 2008 ] TreeView 예제 (0) | 2010.01.10 |
---|---|
[VB 2008] 아래 세개의 프로그래을 하나로 한 것. (0) | 2010.01.09 |
[ VB 2008 ] DrawRectangle 예제 (0) | 2010.01.08 |
[ VB 2008 ] DrawLine 예제 (0) | 2010.01.08 |
[ VB 2008 ]외부 프로그램 실행 하기........ (0) | 2010.01.07 |