Documentation ¶
Overview ¶
Package drawx 图形绘制.
Index ¶
- type Draw
- func (d *Draw) ClearClip() int
- func (d *Draw) D2D_Clear(color int) int
- func (d *Draw) Destroy() int
- func (d *Draw) Dottedline(x1 int, y1 int, x2 int, y2 int) int
- func (d *Draw) DottedlineF(x1, y1, x2, y2 float32) int
- func (d *Draw) DrawArc(x, y int, nWidth int, nHeight int, startAngle float32, sweepAngle float32) int
- func (d *Draw) DrawArcF(x, y, nWidth, nHeight, startAngle, sweepAngle float32) int
- func (d *Draw) DrawCurve(points []xc.POINT, count int, tension float32) int
- func (d *Draw) DrawCurveF(points []xc.POINTF, count int, tension float32) int
- func (d *Draw) DrawEllipse(pRect *xc.RECT) int
- func (d *Draw) DrawLine(x1 int, y1 int, x2 int, y2 int) int
- func (d *Draw) DrawLineF(x1, y1, x2, y2 float32) int
- func (d *Draw) DrawPolygon(points []xc.POINT, nCount int) int
- func (d *Draw) DrawPolygonF(points []xc.POINTF, nCount int) int
- func (d *Draw) DrawRect(pRect *xc.RECT) int
- func (d *Draw) DrawRectF(pRect *xc.RECTF) 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) DrawRoundRectExF(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int
- func (d *Draw) DrawRoundRectF(pRect *xc.RECT, nWidth, nHeight float32) int
- func (d *Draw) DrawSvg(hSvg int, x int, y int) int
- func (d *Draw) DrawSvgEx(hSvg int, x int, y int, nWidth int, nHeight int) int
- func (d *Draw) DrawSvgSize(hSvg int, nWidth int, nHeight int) int
- func (d *Draw) DrawSvgSrc(hSvg int) int
- func (d *Draw) DrawText(lpString string, lpRect *xc.RECT) int
- func (d *Draw) DrawTextF(lpString string, lpRect *xc.RECTF) int
- func (d *Draw) DrawTextUnderline(lpString string, lpRect *xc.RECT, colorLine int) int
- func (d *Draw) DrawTextUnderlineF(lpString string, lpRect *xc.RECTF, colorLine int) 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) FillEllipseF(pRect *xc.RECTF) int
- func (d *Draw) FillPolygon(points []xc.POINT, nCount int) int
- func (d *Draw) FillPolygonF(points []xc.POINTF, nCount int) int
- func (d *Draw) FillRect(pRect *xc.RECT) int
- func (d *Draw) FillRectColor(pRect *xc.RECT, color int) int
- func (d *Draw) FillRectColorF(pRect *xc.RECTF, color int) int
- func (d *Draw) FillRectF(pRect *xc.RECTF) int
- func (d *Draw) FillRoundRect(pRect *xc.RECT, nWidth, nHeight int) int
- func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int) int
- func (d *Draw) FillRoundRectExF(pRect *xc.RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int
- func (d *Draw) FillRoundRectF(pRect *xc.RECTF, nWidth, nHeight float32) int
- func (d *Draw) FocusRect(pRect *xc.RECT) int
- func (d *Draw) FocusRectF(pRect *xc.RECTF) int
- func (d *Draw) GDI_AlphaBlend(nXOriginDest int, nYOriginDest int, nWidthDest int, nHeightDest int, ...) bool
- func (d *Draw) GDI_BitBlt(nXDest int, nYDest int, nWidth int, nHeight int, hdcSrc int, nXSrc int, ...) bool
- func (d *Draw) GDI_BitBlt2(nXDest int, nYDest int, nWidth int, nHeight int, hDrawSrc int, nXSrc int, ...) bool
- func (d *Draw) GDI_CreatePen(fnPenStyle int, nWidth int, crColor int) int
- func (d *Draw) GDI_CreatePolygonRgn(pPt []xc.POINT, cPoints, fnPolyFillMode int) int
- func (d *Draw) GDI_CreateRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) int
- func (d *Draw) GDI_CreateRoundRectRgn(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int, ...) int
- func (d *Draw) GDI_CreateSolidBrush(crColor int) int
- func (d *Draw) GDI_DrawIconEx(xLeft int, yTop int, hIcon int, cxWidth int, cyWidth int, istepIfAniCur int, ...) bool
- func (d *Draw) GDI_Ellipse(pRect *xc.RECT) bool
- func (d *Draw) GDI_FillRgn(hrgn int, hbr int) bool
- func (d *Draw) GDI_FrameRgn(hrgn int, hbr int, nWidth int, nHeight int) bool
- func (d *Draw) GDI_LineTo(nXEnd int, nYEnd int) bool
- func (d *Draw) GDI_MoveToEx(X int, Y int, pPoint *xc.POINT) bool
- func (d *Draw) GDI_Polyline(pArrayPt []xc.POINT, arrayPtSize int) bool
- func (d *Draw) GDI_Rectangle(nLeftRect int, nTopRect int, nRightRect int, nBottomRect int) bool
- func (d *Draw) GDI_RestoreGDIOBJ() int
- func (d *Draw) GDI_SelectClipRgn(hRgn int) int
- func (d *Draw) GDI_SetBkMode(bTransparent bool) int
- func (d *Draw) GDI_SetPixel(X int, Y int, crColor int) int
- func (d *Draw) GetHDC() int
- func (d *Draw) GetOffset(pX *int, pY *int) int
- func (d *Draw) GradientFill2(pRect *xc.RECT, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int
- func (d *Draw) GradientFill2F(pRect *xc.RECTF, color1 int, color2 int, mode xcc.GRADIENT_FILL_) int
- func (d *Draw) GradientFill4(pRect *xc.RECT, color1 int, color2 int, color3 int, color4 int, ...) bool
- func (d *Draw) GradientFill4F(pRect *xc.RECTF, color1 int, color2 int, color3 int, color4 int, ...) bool
- func (d *Draw) Image(hImageFrame int, x, y int) int
- func (d *Draw) ImageAdaptive(hImageFrame int, pRect *xc.RECT, bOnlyBorder bool) int
- func (d *Draw) ImageAdaptiveF(hImageFrame int, pRect *xc.RECTF, bOnlyBorder bool) int
- func (d *Draw) ImageF(hImageFrame int, x, y float32) int
- func (d *Draw) ImageMask(hImageFrame int, hImageFrameMask int, x int, y int, x2 int, y2 int) int
- func (d *Draw) ImageMaskEllipse(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT) int
- func (d *Draw) ImageMaskRect(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT, pRcRoundAngle *xc.RECT) int
- func (d *Draw) ImageSuper(hImageFrame int, pRect *xc.RECT, bClip bool) int
- func (d *Draw) ImageSuperEx(hImageFrame int, prcDest *xc.RECT, prcSrc *xc.RECT) int
- func (d *Draw) ImageSuperExF(hImageFrame int, prcDest *xc.RECTF, prcSrc *xc.RECT) int
- func (d *Draw) ImageSuperF(hImageFrame int, pRect *xc.RECTF, bClip bool) int
- func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, ...) int
- func (d *Draw) ImageTile(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, flag int) int
- func (d *Draw) ImageTileF(hImageFrame int, hImageFrameMask int, pRect *xc.RECTF, flag int) int
- func (d *Draw) SetBrushColor(color int) int
- func (d *Draw) SetClipRect(pRect *xc.RECT) int
- func (d *Draw) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) int
- func (d *Draw) SetFont(hFontx int) int
- func (d *Draw) SetLineWidth(nWidth int) int
- func (d *Draw) SetLineWidthF(nWidth float32) int
- func (d *Draw) SetOffset(x int, y int) int
- func (d *Draw) SetTextAlign(nFlags xcc.TextFormatFlag_) int
- func (d *Draw) SetTextRenderingHint(nType 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) TextOutAF(nXStart, nYStart float32, lpString string) int
- func (d *Draw) TextOutEx(nXStart int, nYStart int, lpString string) int
- func (d *Draw) TextOutExF(nXStart, nYStart float32, lpString string) int
- func (d *Draw) TextOutF(nXStart, nYStart float32, lpString string, cbString string) int
- func (d *Draw) XDraw_GetD2dRenderTarget() int
- func (d *Draw) XDraw_ImageEx(hImageFrame int, x, y, width, height int) int
- func (d *Draw) XDraw_ImageExF(hImageFrame int, x, y, width, height float32) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Draw ¶
type Draw struct {
objectbase.ObjectBase
}
图形绘制.
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) DrawArcF ¶
绘制_圆弧F.
x: 坐标.
y: 坐标.
nWidth: 宽度.
nHeight: 高度.
startAngle: 起始角度.
sweepAngle: 绘制角度, 从起始角度开始计算.
func (*Draw) DrawCurve ¶
绘制_曲线, D2D暂时留空.
points: 坐标点数组.
count: 数组大小.
tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数。.
func (*Draw) DrawCurveF ¶
绘制_曲线F, D2D暂时留空.
points: 坐标点数组.
count: 数组大小.
tension: 大于或等于0.0F的值,指定曲线的张力, D2D 忽略此参数。.
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) DrawRoundRectExF ¶
func (d *Draw) DrawRoundRectExF(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int
绘制_圆角矩形扩展F, 绘制圆角矩形边框.
pRect: 坐标.
nLeftTop: 圆角大小.
nRightTop: 圆角大小.
nRightBottom: 圆角大小.
nLeftBottom: 圆角大小.
func (*Draw) EnableWndTransparent ¶
绘制_启用窗口透明判断, 当启用之后, 调用GDI+函数时, 如果参数alpha=255, 将自动修改为254, 应对GDI+的bug, 否则透明通道异常.
bTransparent: 是否启用.
func (*Draw) FillRoundRectEx ¶
func (d *Draw) FillRoundRectEx(pRect *xc.RECT, nLeftTop, nRightTop, nRightBottom, nLeftBottom int) int
绘制_填充圆角矩形扩展.
pRect: 坐标.
nLeftTop: 圆角大小.
nRightTop: 圆角大小.
nRightBottom: 圆角大小.
nLeftBottom: 圆角大小.
func (*Draw) FillRoundRectExF ¶
func (d *Draw) FillRoundRectExF(pRect *xc.RECTF, nLeftTop, nRightTop, nRightBottom, nLeftBottom float32) int
绘制_填充圆角矩形扩展F.
pRect: 坐标.
nLeftTop: 圆角大小.
nRightTop: 圆角大小.
nRightBottom: 圆角大小.
nLeftBottom: 圆角大小.
func (*Draw) GDI_AlphaBlend ¶
func (d *Draw) GDI_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) GDI_BitBlt ¶
func (d *Draw) GDI_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) GDI_BitBlt2 ¶
func (d *Draw) GDI_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) GDI_CreatePen ¶
绘制_创建画笔, GDI创建一个逻辑笔, 指定的样式, 宽度和颜色, 随后的笔可以选择到设备上下文, 用于绘制线条和曲线.
fnPenStyle: 画笔样式, PS_SOLID:实线, PS_DASH:段线, PS_DOT:点线, PS_DASHDOT:段线_点线, PS_DASHDOTDOT:段线_点_点, PS_NULL:空, PS_INSIDEFRAME:实线_笔宽是向里扩展.
nWidth: 画笔宽度.
crColor: ABGR颜色.
func (*Draw) GDI_CreatePolygonRgn ¶
绘制_创建多边形区域, GDI创建一个多边形区域, 成功返回区域句柄, 失败返回NULL.
pPt: POINT数组.
cPoints: 数组大小.
fnPolyFillMode: 多边形填充模式, 指定用于确定在该地区的像素填充模式,这个参数可以是下列值之一.
ALTERNATE Selects alternate mode (fills area between odd-numbered and even-numbered polygon sides on each scan line).
WINDING Selects winding mode (fills any region with a nonzero winding value).
func (*Draw) GDI_CreateRectRgn ¶
绘制_创建矩形区域, GDI创建矩形区域, 成功返回区域句柄, 失败返回NULL.
nLeftRect: 左上角X坐标.
nTopRect: 左上角Y坐标.
nRightRect: 右下角X坐标.
nBottomRect: 右下角Y坐标.
func (*Draw) GDI_CreateRoundRectRgn ¶
func (d *Draw) GDI_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) GDI_DrawIconEx ¶
func (d *Draw) GDI_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) GDI_FrameRgn ¶
绘制_边框区域, 绘制边框, 使用指定的画刷绘制指定的区域的边框. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零.
hrgn: 区域句柄.
hbr: 画刷句柄.
nWidth: 边框宽度, 垂直边.
nHeight: 边框高度, 水平边.
func (*Draw) GDI_LineTo ¶
绘制_线终点, 函数绘制一条线从当前位置到, 但不包括指定点. 如果函数成功, 返回非零值.
nXEnd: X坐标, 线结束点.
nYEnd: Y坐标, 线结束点.
func (*Draw) GDI_MoveToEx ¶
绘制_移动到起点, 更新当前位置到指定点,并返回以前的位置. 如果函数成功, 返回非零值.
X: 坐标.
Y: 坐标.
pPoint: 接收以前的当前位置到一个POINT结构的指针, 如果这个参数是NULL指针, 没有返回原来的位置.
func (*Draw) GDI_Rectangle ¶
绘制_矩形, 绘制矩形, 使用当前的画刷和画笔. 如果函数成功, 返回非零值, 如果函数失败, 返回值是零.
nLeftRect: 左上角X坐标.
nTopRect: 左上角Y坐标.
nRightRect: 右下角X坐标.
nBottomRect: 右下角Y坐标.
func (*Draw) GDI_RestoreGDIOBJ ¶
绘制_还原状态, 还原状态, 释放用户绑定的GDI对象, 例如画刷, 画笔.
func (*Draw) GDI_SelectClipRgn ¶
绘制_选择裁剪区域, 选择一个区域作为当前裁剪区域, 注意: 该函数只对GDI有效.
hRgn: 区域句柄.
返回: 返回值指定地区的复杂性,可以是下列值之一.
NULLREGION Region is empty.
SIMPLEREGION Region is a single rectangle.
COMPLEXREGION Region is more than one rectangle.
ERROR An error occurred. (The previous clipping region is unaffected).
func (*Draw) GDI_SetPixel ¶
绘制_置像素颜色, 函数设置在指定的坐标到指定的颜色的像素. 如果函数成功返回RGB值, 如果失败返回-1.
X: 坐标.
Y: 坐标.
crColor: RGB颜色值.
func (*Draw) GradientFill2 ¶
绘制_渐变填充2, 渐变填充, 从一种颜色过渡到另一种颜色.
pRect: 矩形坐标.
color1: 开始颜色, ABGR颜色.
color2: 结束颜色, ABGR颜色.
mode: 模式, GRADIENT_FILL_.
func (*Draw) GradientFill2F ¶
绘制_渐变填充2F, 渐变填充, 从一种颜色过渡到另一种颜色.
pRect: 矩形坐标.
color1: 开始颜色, ABGR颜色.
color2: 结束颜色, ABGR颜色.
mode: 模式, GRADIENT_FILL_.
func (*Draw) GradientFill4 ¶
func (d *Draw) GradientFill4(pRect *xc.RECT, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool
绘制_渐变填充4, 渐变填充,从一种颜色过渡到另一种颜色.
pRect: 矩形坐标.
color1: 开始颜色, ABGR颜色.
color2: 结束颜色, ABGR颜色.
color3: 开始颜色, ABGR颜色.
color4: 结束颜色, ABGR颜色.
mode: 模式, GRADIENT_FILL_.
func (*Draw) GradientFill4F ¶
func (d *Draw) GradientFill4F(pRect *xc.RECTF, color1 int, color2 int, color3 int, color4 int, mode xcc.GRADIENT_FILL_) bool
绘制_渐变填充4F, 渐变填充,从一种颜色过渡到另一种颜色.
pRect: 矩形坐标.
color1: 开始颜色, ABGR颜色.
color2: 结束颜色, ABGR颜色.
color3: 开始颜色, ABGR颜色.
color4: 结束颜色, ABGR颜色.
mode: 模式, GRADIENT_FILL_.
func (*Draw) ImageMask ¶
绘制_图片遮盖, 绘制带遮盖的图片, D2D留空.
hImageFrame: 图片句柄.
hImageFrameMask: 图片句柄, 遮盖.
x: hImageFrame X坐标.
y: hImageFrame Y坐标.
x2: hImageFrameMask X坐标.
y2: hImageFrameMask Y坐标.
func (*Draw) ImageMaskEllipse ¶
绘制_图片遮盖椭圆, 绘制带椭圆遮盖的图片, D2D留空.
hImageFrame: 图片句柄.
pRect: .
pRcMask: .
func (*Draw) ImageMaskRect ¶
func (d *Draw) ImageMaskRect(hImageFrame int, pRect *xc.RECT, pRcMask *xc.RECT, pRcRoundAngle *xc.RECT) int
绘制_图片遮盖矩形, 绘制带矩形遮盖的图片, D2D留空.
hImageFrame: 图片句柄.
pRect: .
pRcMask: .
pRcRoundAngle: .
func (*Draw) ImageSuperMask ¶
func (d *Draw) ImageSuperMask(hImageFrame int, hImageFrameMask int, pRect *xc.RECT, pRectMask *xc.RECT, bClip bool) int
绘制_图片增强遮盖, 绘制带遮盖的图片. D2D留空.
hImageFrame: 图片句柄.
hImageFrameMask: 图片句柄, 遮盖.
pRect: 坐标.
pRectMask: 坐标, 遮盖.
bClip: 是否裁剪区域.
func (*Draw) ImageTile ¶
绘制_图片平铺, 绘制图片.
hImageFrame: 图片句柄.
pRect: 坐标.
flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺.
func (*Draw) ImageTileF ¶
绘制_图片平铺F, 绘制图片.
hImageFrame: 图片句柄.
pRect: 坐标.
flag: 标识, 0:从左上角开始平铺, 1:从左下角开始平铺.
func (*Draw) SetD2dTextRenderingMode ¶
func (d *Draw) SetD2dTextRenderingMode(mode xcc.XC_DWRITE_RENDERING_MODE_) int
绘制_置D2D文本渲染模式.
mode 渲染模式 XC_DWRITE_RENDERING_MODE_.
func (*Draw) SetTextAlign ¶
func (d *Draw) SetTextAlign(nFlags xcc.TextFormatFlag_) int
绘制_置文本对齐, 设置文本对齐.
nFlags: 对齐标识, TextFormatFlag_, TextAlignFlag_, TextTrimming_.
func (*Draw) TextOut ¶
绘制_文本, TextOut() 参见MSDN.
nXStart: XX.
nYStart: XX.
lpString: XX.
cbString: XX.
func (*Draw) TextOutF ¶
绘制_文本F, TextOut() 参见MSDN.
nXStart: XX.
nYStart: XX.
lpString: XX.
cbString: XX.
func (*Draw) XDraw_GetD2dRenderTarget ¶
绘制_取D2D渲染目标, 返回 *ID2D1RenderTarget.
func (*Draw) XDraw_ImageEx ¶
绘制_图片扩展, 绘制图片.
hImageFrame: 图片句柄.
x: x坐标.
y: y坐标.
width: 宽度.
height: 高度.