描述
获取此画笔的换行模式.包模式确定区域如何平铺时,用画笔绘制.
C++ Syntax
WrapMode GetWrapMode() const; |
FreeBASIC 语法
FUNCTION GetWrapMode () AS WrapMode |
参数
该方法没有参数.
返回值
此方法返回下列元素的WrapMode枚举:
· | WrapModeTile |
· | WrapModeTileFlipX |
· | WrapModeTileFlipY |
· | WrapModeTileFlipXY |
引用文件
CGpBrush.inc (include CGdiPlus.inc)
示例
' ========================================================================================
' The following example creates a linear gradient brush and sets its wrap mode. Next, the
' code gets the brush's wrap mode and performs tasks based on the brush's current wrap mode.
' ========================================================================================
SUB Example_GetWrapMode (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context
DIM graphics AS CGpGraphics = hdc
' // Get the DPI scaling ratio
DIM rxRatio AS SINGLE = graphics.GetDpiX / 96
DIM ryRatio AS SINGLE = graphics.GetDpiY / 96
' // Set the scale transform
graphics.ScaleTransform(rxRatio, ryRatio)
' // Create a linear gradient brush.
DIM rc AS GpRect = GDIP_RECT(0, 0, 100, 50)
DIM linGrBrush AS CGpLinearGradientBrush = CGpLinearGradientBrush(@rc, _
GDIP_ARGB(255, 0, 0, 0), GDIP_ARGB(255, 0, 0, 255), LinearGradientModeHorizontal)
linGrBrush.SetWrapMode(WrapModeTileFlipX)
' // Obtain information about the linear gradient brush.
DIM nWrapMode AS WrapMode
nWrapMode = linGrBrush.GetWrapMode
IF nWrapMode = WrapModeTileFlipX THEN
' // Do some task
ELSEIF nWrapMode = WrapModeTileFlipY THEN
' // Do a different task
END IF
END SUB
' ========================================================================================