/
canvasdef.go
103 lines (84 loc) · 2.57 KB
/
canvasdef.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
package vcl
import (
. "github.com/ying32/govcl/vcl/api"
. "github.com/ying32/govcl/vcl/types"
)
// 画刷复制
func (c *TCanvas) BrushCopy(dest TRect, bitmap IObject, source TRect, color TColor) {
Canvas_BrushCopy(c.instance, dest, CheckPtr(bitmap), source, color)
}
// 复制矩形
func (c *TCanvas) CopyRect(dest TRect, canvas IObject, source TRect) {
Canvas_CopyRect(c.instance, dest, CheckPtr(canvas), source)
}
// 绘制graphic对象
func (c *TCanvas) Draw(x, y int32, graphic IObject) {
Canvas_Draw1(c.instance, x, y, CheckPtr(graphic))
}
// 绘制graphic对象,opacity透明度
func (c *TCanvas) Draw2(x, y int32, graphic IObject, opacity uint8) {
Canvas_Draw2(c.instance, x, y, CheckPtr(graphic), opacity)
}
// 画焦点矩形
func (c *TCanvas) DrawFocusRect(aRect TRect) {
Canvas_DrawFocusRect(c.instance, aRect)
}
// 填充矩形
func (c *TCanvas) FillRect(aRect TRect) {
Canvas_FillRect(c.instance, aRect)
}
// 绘制边框
func (c *TCanvas) FrameRect(aRect TRect) {
Canvas_FrameRect(c.instance, aRect)
}
// 拉伸绘制
func (c *TCanvas) StretchDraw(aRect TRect, graphic IObject) {
Canvas_StretchDraw(c.instance, aRect, CheckPtr(graphic))
}
// 在矩形内绘制文字
func (c *TCanvas) TextRect(aRect TRect, x, y int32, text string) {
Canvas_TextRect1(c.instance, aRect, x, y, text)
}
// 在矩形内绘制文字
func (c *TCanvas) TextRect2(aRect *TRect, text *string, textFormat TTextFormat) {
Canvas_TextRect2(c.instance, aRect, text, textFormat)
}
// 在矩形内绘制文字
func (c *TCanvas) TextRect3(aRect *TRect, text string, textFormat TTextFormat) {
Canvas_TextRect3(c.instance, aRect, text, textFormat)
}
// 填充多边形
func (c *TCanvas) Polygon(points []TPoint) {
Canvas_Polygon(c.instance, points)
}
// 画多边形,不填充
func (c *TCanvas) Polyline(points []TPoint) {
Canvas_Polyline(c.instance, points)
}
// 多边形贝塞尔曲线
func (c *TCanvas) PolyBezier(points []TPoint) {
Canvas_PolyBezier(c.instance, points)
}
// 仅libvcl
func (c *TCanvas) PolyBezierTo(points []TPoint) {
Canvas_PolyBezierTo(c.instance, points)
}
// 获取指定位置的颜色
//
// Get the color at the specified position
func (c *TCanvas) Pixels(x, y int32) TColor {
return Canvas_Pixels(c.instance, x, y)
}
// 设置指定位置的颜色。
//
// Set the color at the specified position.
func (c *TCanvas) SetPixels(x, y int32, value TColor) {
Canvas_SetPixels(c.instance, x, y, value)
}