Documentation ¶
Overview ¶
图形绘制
Index ¶
- type Draw
- func (d *Draw) AlphaBlend(nXOriginDest int, nYOriginDest int, nWidthDest int, nHeightDest int, ...) bool
- func (d *Draw) BitBlt(nXDest int, nYDest int, nWidth int, nHeight int, hdcSrc int, nXSrc int, ...) bool
- func (d *Draw) BitBlt2(nXDest int, nYDest int, nWidth int, nHeight int, hDrawSrc int, nXSrc int, ...) bool
- func (d *Draw) Check(x int, y int, color int, bCheck bool) int
- func (d *Draw) ClearClip() int
- func (d *Draw) CreatePen(fnPenStyle int, nWidth int, crColor int) int
- func (d *Draw) CreatePolygonRgn(pPt *xc.POINT, cPoints int, fnPolyFillMode int) int
- func (d *Draw) CreateRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) int
- func (d *Draw) CreateRoundRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int, ...) int
- func (d *Draw) CreateSolidBrush(crColor int) int
- func (d *Draw) Destroy() int
- func (d *Draw) Dottedline(x1 int, y1 int, x2 int, y2 int) int
- func (d *Draw) DrawArc(x, y int, nWidth int, nHeight int, startAngle float32, sweepAngle float32) int
- func (d *Draw) DrawCurve(points int, count int, tension float32) int
- func (d *Draw) DrawEllipse(pRect *xc.RECT) int
- func (d *Draw) DrawGroupBox_Rect(pRect *xc.RECT, pName string, textColor int, textAlpha uint8, ...) int
- func (d *Draw) DrawGroupBox_RoundRect(pRect *xc.RECT, pName string, textColor int, textAlpha uint8, ...) int
- func (d *Draw) DrawIconEx(xLeft int, yTop int, hIcon int, cxWidth int, cyWidth int, istepIfAniCur int, ...) bool
- func (d *Draw) DrawLine(x1 int, y1 int, x2 int, y2 int) int
- func (d *Draw) DrawPolygon(points int, nCount int) int
- func (d *Draw) DrawPolygonF(points int, nCount int) int
- func (d *Draw) DrawRoundRect(pRect *xc.RECT, nWidth int, nHeight int) int
- func (d *Draw) DrawRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int
- func (d *Draw) DrawText(lpString string, nCount int, lpRect *xc.RECT) int
- func (d *Draw) DrawTextUnderline(lpString string, nCount int, lpRect *xc.RECT, colorLine int, alphaLine uint8) int
- func (d *Draw) EnableSmoothingMode(bEnable bool) int
- func (d *Draw) EnableWndTransparent(bTransparent bool) int
- func (d *Draw) FillEllipse(pRect *xc.RECT) int
- func (d *Draw) FillPolygon(points int, nCount int) int
- func (d *Draw) FillPolygonF(points int, nCount int) int
- func (d *Draw) FillRect(pRect *xc.RECT) int
- func (d *Draw) FillRectColor(pRect *xc.RECT, color int, alpha uint8) int
- func (d *Draw) FillRgn(hrgn int, hbr int) bool
- func (d *Draw) FillRoundRect(pRect *xc.RECT, nWidth int, nHeight int) int
- func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int
- func (d *Draw) FocusRect(pRect *xc.RECT) int
- func (d *Draw) FrameRect(pRect *xc.RECT) int
- func (d *Draw) FrameRgn(hrgn int, hbr int, nWidth int, nHeight int) bool
- func (d *Draw) GetHDC() int
- func (d *Draw) GetOffset(pX *int, pY *int) int
- func (d *Draw) GradientFill2(color1 int, alpha1 uint8, color2 int, alpha2 uint8, pRect *xc.RECT, mode int) int
- func (d *Draw) GradientFill4(color1 int, color2 int, color3 int, color4 int, pRect *xc.RECT, mode int) bool
- func (d *Draw) Image(hImageFrame int, x int, y int) int
- func (d *Draw) Image2(hImageFrame int, x int, y int, width int, height int) int
- func (d *Draw) ImageAdaptive(hImageFrame int, pRect *xc.RECT, bOnlyBorder bool) int
- func (d *Draw) ImageExTile(hImageFrame int, pRect *xc.RECT, flag int) int
- func (d *Draw) ImageMask(hImageFrame int, hImageFrameMask int, x int, y int, x2 int, y2 int) int
- func (d *Draw) ImageStretch(hImageFrame int, x int, y int, width int, height int) int
- func (d *Draw) ImageSuper(hImageFrame int, pRect *xc.RECT, bClip bool) int
- func (d *Draw) ImageSuper2(hImageFrame int, prcDest *xc.RECT, prcSrc *xc.RECT) int
- func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, ...) int
- func (d *Draw) LineTo(nXEnd int, nYEnd int) bool
- func (d *Draw) MoveToEx(X int, Y int, pPoint *xc.POINT) bool
- func (d *Draw) Polyline(pArrayPt int, arrayPtSize int) bool
- func (d *Draw) Rectangle(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) bool
- func (d *Draw) RestoreGDIOBJ() int
- func (d *Draw) SelectClipRgn(hRgn int) int
- func (d *Draw) SetBkMode(bTransparent bool) int
- func (d *Draw) SetBrushColor(color int, alpha uint8) int
- func (d *Draw) SetClipRect(pRect *xc.RECT) int
- func (d *Draw) SetFontX(hFontx int) int
- func (a *Draw) SetHandle(hDraw int)
- func (d *Draw) SetLineWidth(nWidth int) int
- func (d *Draw) SetOffset(x int, y int) int
- func (d *Draw) SetPixel(X int, Y int, crColor int) int
- func (d *Draw) SetTextAlign(nFlags int) int
- func (d *Draw) SetTextVertical(bVertical bool) int
- func (d *Draw) TextOut(nXStart int, nYStart int, lpString string, cbString string) int
- func (d *Draw) TextOutA(nXStart int, nYStart int, lpString string) int
- func (d *Draw) TextOutEx(nXStart int, nYStart int, lpString string) int
- func (d *Draw) TriangularArrow(align int, x int, y int, width int, height int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Draw ¶
type Draw struct {
Handle int // HDRAW
}
图形绘制
func (*Draw) AlphaBlend ¶
func (d *Draw) AlphaBlend(nXOriginDest int, nYOriginDest int, nWidthDest int, nHeightDest int, hdcSrc int, nXOriginSrc int, nYOriginSrc int, nWidthSrc int, nHeightSrc int, alpha int) bool
绘制_带透明复制, AlphaBlend() 参见MSDN. nXOriginDest: XX. nYOriginDest: XX. nWidthDest: XX. nHeightDest: XX. hdcSrc: XX. nXOriginSrc: XX. nYOriginSrc: XX. nWidthSrc: XX. nHeightSrc: XX. alpha: XX.
func (*Draw) BitBlt ¶
func (d *Draw) BitBlt(nXDest int, nYDest int, nWidth int, nHeight int, hdcSrc int, nXSrc int, nYSrc int, dwRop int) bool
绘制_复制, BitBlt() 参见MSDN. nXDest: XX. nYDest: XX. nWidth: XX. nHeight: XX. hdcSrc: XX. nXSrc: XX. nYSrc: XX. dwRop: XX.
func (*Draw) BitBlt2 ¶
func (d *Draw) BitBlt2(nXDest int, nYDest int, nWidth int, nHeight int, hDrawSrc int, nXSrc int, nYSrc int, dwRop int) bool
绘制_复制2, BitBlt() 参见MSDN. nXDest: XX. nYDest: XX. nWidth: XX. nHeight: XX. hDrawSrc: XX. nXSrc: XX. nYSrc: XX. dwRop: XX.
func (*Draw) CreatePen ¶
绘制_创建画笔, GDI创建一个逻辑笔, 指定的样式, 宽度和颜色, 随后的笔可以选择到设备上下文, 用于绘制线条和曲线 fnPenStyle: 画笔样式. nWidth: 画笔宽度. crColor: 颜色.
func (*Draw) CreatePolygonRgn ¶
绘制_创建多边形区域, GDI创建一个多边形区域, 成功返回区域句柄, 失败返回NULL pPt: POINT数组. cPoints: 数组大小. fnPolyFillMode: 多边形填充模式
func (*Draw) CreateRectRgn ¶
绘制_创建矩形区域, GDI创建矩形区域, 成功返回区域句柄, 失败返回NULL nLeftRect: 左上角X坐标. nTopRect: 左上角Y坐标. nRightRect: 右下角X坐标. nBottomRect: 右下角Y坐标.
func (*Draw) CreateRoundRectRgn ¶
func (d *Draw) CreateRoundRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int, nWidthEllipse int, nHeightEllipse int) int
绘制_创建圆角矩形区域, GDI创建一个圆角的矩形区域, 成功返回区域句柄, 失败返回NULL nLeftRect: X-坐标的左上角. nTopRect: Y-坐标左上角坐标 nRightRect: X-坐标右下角 nBottomRect: Y-坐标右下角 nWidthEllipse: 椭圆的宽度. nHeightEllipse: 椭圆的高度.
func (*Draw) CreateSolidBrush ¶
绘制_创建实心画刷, GDI创建具有指定的纯色逻辑刷 crColor: 画刷颜色.
func (*Draw) Dottedline ¶
绘制_点线, 绘制水平或垂直虚线. x1: 起点x坐标. y1: 起点y坐标. x2: 结束点x坐标. y2: 结束点y坐标.
func (*Draw) DrawArc ¶
func (d *Draw) DrawArc(x, y int, nWidth int, nHeight int, startAngle float32, sweepAngle float32) int
绘制_圆弧. x: 坐标. y: 坐标. nWidth: 宽度. nHeight: 高度. startAngle: 起始角度. sweepAngle: 绘制角度, 从起始角度开始计算.
func (*Draw) DrawGroupBox_Rect ¶
func (d *Draw) DrawGroupBox_Rect(pRect *xc.RECT, pName string, textColor int, textAlpha uint8, pOffset *xc.POINT) int
绘制_组框, 绘制组框, 矩形边框 pRect: 矩形坐标. pName: 标题名称. textColor: 文本颜色. textAlpha: 文本透明度. pOffset: 文本偏移
func (*Draw) DrawGroupBox_RoundRect ¶
func (d *Draw) DrawGroupBox_RoundRect(pRect *xc.RECT, pName string, textColor int, textAlpha uint8, pOffset *xc.POINT, nWidth int, nHeight int) int
绘制_组框圆角, 绘制组框, 圆角边框 pRect: 矩形坐标. pName: 标题名称. textColor: 文本颜色. textAlpha: 文本透明度. pOffset: 文本偏移 nWidth: 圆角宽度. nHeight: 圆角高度.
func (*Draw) DrawIconEx ¶
func (d *Draw) DrawIconEx(xLeft int, yTop int, hIcon int, cxWidth int, cyWidth int, istepIfAniCur int, hbrFlickerFreeDraw int, diFlags int) bool
绘制_图标, 绘制图标, DrawIconEx()参见MSDN. xLeft: . yTop: . hIcon: . cxWidth: . cyWidth: . istepIfAniCur: . hbrFlickerFreeDraw: . diFlags: .
func (*Draw) DrawPolygon ¶
绘制_多边形, 绘制多边形. points: 顶点坐标数组. nCount: 顶点数量.
func (*Draw) DrawPolygonF ¶
绘制_多边形F, 绘制多边形. points: 顶点坐标数组. nCount: 顶点数量.
func (*Draw) DrawRoundRect ¶
绘制_圆角矩形, 绘制圆角矩形边框 pRect: 矩形坐标. nWidth: 圆角宽度. nHeight: 圆角高度.
func (*Draw) DrawRoundRectEx ¶
func (d *Draw) DrawRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int
绘制_圆角矩形扩展, 绘制圆角矩形边框 pRect: 坐标. nLeftTop: 圆角大小. nRightTop: 圆角大小. nRightBottom: 圆角大小. nLeftBottom: 圆角大小.
func (*Draw) DrawTextUnderline ¶
func (d *Draw) DrawTextUnderline(lpString string, nCount int, lpRect *xc.RECT, colorLine int, alphaLine uint8) int
绘制_文本下划线 lpString: 字符串. nCount: 字符串长度. lpRect: 坐标. colorLine: 下划线颜色. alphaLine: 下划线透明度.
func (*Draw) EnableSmoothingMode ¶
绘制_启用平滑模式 bEnable: 是否启用.
func (*Draw) EnableWndTransparent ¶
绘制_启用窗口透明判断, 当启用之后, 调用GDI+函数时, 如果参数alpha=255, 将自动修改为254, 应对GDI+的bug, 否则透明通道异常 bTransparent: 是否启用
func (*Draw) FillPolygon ¶
绘制_填充多边形, 填充多边形. points: 顶点坐标数组. nCount: 顶点数量.
func (*Draw) FillPolygonF ¶
绘制_填充多边形F, 填充多边形. points: 顶点坐标数组. nCount: 顶点数量.
func (*Draw) FillRectColor ¶
绘制_填充矩形指定颜色 pRect: 矩形区域. color: RGB颜色. alpha: 透明度.
func (*Draw) FillRoundRect ¶
绘制_填充圆角矩形 pRect: 矩形坐标. nWidth: 圆角宽度. nHeight: 圆角高度.
func (*Draw) FillRoundRectEx ¶
func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop int, nRightTop int, nRightBottom int, nLeftBottom int) int
绘制_填充圆角矩形扩展 pRect: 坐标. nLeftTop: 圆角大小. nRightTop: 圆角大小. nRightBottom: 圆角大小. nLeftBottom: 圆角大小.
func (*Draw) FrameRgn ¶
绘制_边框区域, 绘制边框, 使用指定的画刷绘制指定的区域的边框. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零 hrgn: 区域句柄. hbr: 画刷句柄. nWidth: 边框宽度 nHeight: 边框高度
func (*Draw) GradientFill2 ¶
func (d *Draw) GradientFill2(color1 int, alpha1 uint8, color2 int, alpha2 uint8, pRect *xc.RECT, mode int) int
绘制_渐变填充2, 渐变填充, 从一种颜色过渡到另一种颜色 color1: 开始颜色. alpha1: 透明度. color2: 结束颜色. alpha2: 透明度. pRect: 矩形坐标. mode: 模式, GRADIENT_FILL_
func (*Draw) GradientFill4 ¶
func (d *Draw) GradientFill4(color1 int, color2 int, color3 int, color4 int, pRect *xc.RECT, mode int) bool
绘制_渐变填充4, 渐变填充,从一种颜色过渡到另一种颜色 color1: 开始颜色. color2: 结束颜色 color3: 开始颜色 color4: 结束颜色. pRect: 矩形坐标. mode: 模式, GRADIENT_FILL_
func (*Draw) ImageAdaptive ¶
绘制_图片自适应 hImageFrame: 图片句柄. pRect: 坐标. bOnlyBorder: 是否只绘制边缘区域.
func (*Draw) ImageExTile ¶
绘制_图片平铺 hImageFrame: 图片句柄. pRect: 坐标. flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺.
func (*Draw) ImageMask ¶
绘制_图片遮盖, 绘制带遮盖的图片. hImageFrame: 图片句柄. hImageFrameMask: 图片句柄 x: hImageFrame X坐标. y: hImageFrame Y坐标. x2: hImageFrameMask X坐标. y2: hImageFrameMask Y坐标.
func (*Draw) ImageStretch ¶
绘制_图片缩放 hImageFrame: 图片句柄. x: x坐标. y: y坐标. width: 宽度. height: 高度.
func (*Draw) ImageSuper ¶
绘制_图片增强 hImageFrame: 图片句柄. pRect: 坐标. bClip: 是否裁剪区域.
func (*Draw) ImageSuper2 ¶
绘制_图片增强2 hImageFrame: 图片句柄. prcDest: 目标坐标. prcSrc: 源坐标.
func (*Draw) ImageSuperMask ¶
func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, bClip bool) int
绘制_图片增强遮盖, 绘制带遮盖的图片. hImageFrame: 图片句柄. hImageFrameMask: 图片句柄, 遮盖. pRect: 坐标. pRectMask: 坐标, 遮盖. bClip: 是否裁剪区域.
func (*Draw) MoveToEx ¶
绘制_移动到起点, 更新当前位置到指定点,并返回以前的位置. 如果函数成功, 返回非零值. X: 坐标. Y: 坐标. pPoint: 接收以前的当前位置到一个POINT结构的指针, 如果这个参数是NULL指针, 没有返回原来的位置
func (*Draw) Rectangle ¶
绘制_矩形, 绘制矩形, 使用当前的画刷和画笔. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零 nLeftRect: 左上角X坐标. nTopRect: 左上角Y坐标. nRightRect: 右下角X坐标. nBottomRect: 右下角Y坐标.
func (*Draw) RestoreGDIOBJ ¶
绘制_还原状态, 还原状态, 释放用户绑定的GDI对象, 例如画刷, 画笔
func (*Draw) SelectClipRgn ¶
绘制_选择裁剪区域, 选择一个区域作为当前裁剪区域, 注意: 该函数只对GDI有效 hRgn: 区域句柄.
func (*Draw) SetBrushColor ¶
绘制_置画刷颜色, 设置画刷颜色 color: RGB颜色值 alpha: 透明度, 0-255, 0完全透明, 255不透明
func (*Draw) SetClipRect ¶
绘制_置裁剪区域, 设置裁剪区域 pRect: 区域坐标.
func (*Draw) SetPixel ¶
绘制_置像素颜色, 函数设置在指定的坐标到指定的颜色的像素. 如果函数成功返回RGB值, 如果失败返回-1 X: 坐标 Y: 坐标 crColor: RGB颜色值
func (*Draw) SetTextAlign ¶
绘制_置文本对齐, 设置文本对齐 nFlags: 对齐标识, TextFormatFlag_, TextAlignFlag_, TextTrimming_
func (*Draw) SetTextVertical ¶
绘制_置文本垂直, 设置文本垂直显示 bVertical: 是否垂直显示文本.
func (*Draw) TextOut ¶
绘制_文本, TextOut() 参见MSDN. nXStart: XX. nYStart: XX. lpString: XX. cbString: XX.