forked from shahfarhadreza/go-gdiplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
path.go
47 lines (36 loc) · 1.29 KB
/
path.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package gdiplus
type GraphicsPath struct {
nativePath *GpPath
}
func NewPath(fillMode int32) *GraphicsPath {
p := &GraphicsPath{}
GdipCreatePath(fillMode, &p.nativePath)
return p
}
func (p *GraphicsPath) AddArcRect(rect *Rect, startAngle, sweepAngle float32) {
GdipAddPathArcI(p.nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
}
func (p *GraphicsPath) AddArcRectF(rect *RectF, startAngle, sweepAngle float32) {
GdipAddPathArc(p.nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
}
func (p *GraphicsPath) AddArc(x, y, width, height, startAngle, sweepAngle float32) {
GdipAddPathArc(p.nativePath, x, y, width, height, startAngle, sweepAngle)
}
func (p *GraphicsPath) AddArcI(x, y, width, height int32, startAngle, sweepAngle float32) {
GdipAddPathArcI(p.nativePath, x, y, width, height, startAngle, sweepAngle)
}
func (p *GraphicsPath) AddLine(x1, y1, x2, y2 float32) {
GdipAddPathLine(p.nativePath, x1, y1, x2, y2)
}
func (p *GraphicsPath) AddLineI(x1, y1, x2, y2 int32) {
GdipAddPathLineI(p.nativePath, x1, y1, x2, y2)
}
func (p *GraphicsPath) CloseAllFigures() {
GdipClosePathFigures(p.nativePath)
}
func (p *GraphicsPath) CloseFigure() {
GdipClosePathFigure(p.nativePath)
}
func (p *GraphicsPath) Dispose() {
GdipDeletePath(p.nativePath)
}