导航:  GdiPlus Classes > GdiPlus Classes > CGpBrush Class > CGpPathGradientBrush Class > PathGradientBrush Object >

GetWrapMode

上一页返回章节概述下一页

描述

 

获取此路径渐变画笔当前设置的换行模式.

 

C++ Syntax

 

WrapMode GetWrapMode() const;

 

FreeBASIC 语法

 

FUNCTION GetWrapMode () AS WrapMode

 

参数

 

该方法没有参数.

 

返回值

 

此方法返回表示当前设置该路径渐变画笔的包装模式的WrapMode枚举元素.

 

备注

 

路径渐变刷的边界矩形是包围画笔边界路径的最小矩形.使用路径渐变画笔绘制边界矩形时,只有边界路径中的区域被填充.边界矩形内的区域,但在边界路径外不填充.

用路径渐变画笔的默认换行模式wrapmodeclamp,这表明没有绘画出现的矩形外刷.所有其他包模式表明,刷边界矩形外的区域将平铺.每个瓦片是一个拷贝(可能翻转)的填充路径内的边界矩形.

 

引用文件

 

CGpBrush.inc (include CGdiPlus.inc)

 

示例

 

' ========================================================================================

' The following example creates a PathGradientBrush object based on a triangular path. The

' code calls the PathGradientBrush.SetWrapMode method of the PathGradientBrush object to

' set the wrap mode to WrapModeTileFlipX. Next, the code calls the PathGradientBrush.GetWrapMode

' method of the PathGradientBrush object to obtain the brush's wrap mode. If the obtained

' wrap mode is WrapModeTileFlipX, the code calls FillRectangle to tile a large area with

' the path gradient brush.

' ========================================================================================

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)

 

  DIM points(0 TO 2) AS GpPoint = {GDIP_POINT(0, 0), GDIP_POINT(100, 0), GDIP_POINT(100, 100)}

  DIM colors(0 TO 2) AS ARGB = {GDIP_ARGB(255, 255, 0, 0), GDIP_ARGB(255, 0, 0, 255), GDIP_ARGB(255, 0, 255, 0)}

 

  DIM nCount AS LONG = 3

  DIM pthGrBrush AS CGpPathGradientBrush = CGpPathGradientBrush(@points(0), 3)

  pthGrBrush.SetSurroundColors(@colors(0), @nCount)

  pthGrBrush.SetWrapMode(WrapModeTileFlipX)

 

  ' // Obtain information about the path gradient brush.

  DIM nWrapMode AS WrapMode = pthGrBrush.GetWrapMode

 

  IF nWrapMode = WrapModeTileFlipX THEN

     graphics.FillRectangle(@pthGrBrush, 0, 0, 800, 800)

  END IF

 

END SUB

' ========================================================================================