Toggle navigation
Toggle navigation
This project
Loading...
Sign in
남윤형
/
flowchart_draw
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
남윤형
2021-05-16 13:21:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9ddfed0579c1e36108267601955c44d9d32c7dd
f9ddfed0
1 parent
898d9f95
마름모 클래스 생성(마름모가 없어서 직접 구현함)
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
FigRhombus.cs
FigRhombus.cs
0 → 100644
View file @
f9ddfed
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
flowchart
{
// 프로세스 마름모를 그리는 클래스(FigureBase를 상속)
// Draw 함수에서 마름모를 그린다.
class
FigRhombus
:
FigBase
{
// 생성자도 상속해서 사용.
public
FigRhombus
(
Point
location
,
Size
size
)
:
base
(
location
,
size
)
{
}
public
override
void
Draw
(
Graphics
g
)
{
using
(
Pen
pen
=
new
Pen
(
Color
.
Red
,
1
))
{
System
.
Drawing
.
Rectangle
rect
=
new
System
.
Drawing
.
Rectangle
(
this
.
Location
,
this
.
Size
);
// 마름모 그리는 함수
int
x1
,
x2
,
x3
,
y1
,
y2
,
y3
;
x1
=
Location
.
X
;
x2
=
x1
+
Size
.
Width
/
2
;
x3
=
x1
+
Size
.
Width
;
y1
=
Location
.
Y
;
y2
=
y1
-
Size
.
Height
/
2
;
y3
=
y1
-
Size
.
Height
;
g
.
DrawLine
(
pen
,
x1
,
y2
,
x2
,
y1
);
g
.
DrawLine
(
pen
,
x2
,
y1
,
x3
,
y2
);
g
.
DrawLine
(
pen
,
x3
,
y2
,
x2
,
y3
);
g
.
DrawLine
(
pen
,
x2
,
y3
,
x1
,
y2
);
}
base
.
Draw
(
g
);
}
}
}
Please
register
or
login
to post a comment