描述
将此纹理画笔的变换矩阵重置为标识矩阵.这意味着没有转换发生.
C++ Syntax
Status ResetTransform(); |
FreeBASIC 语法
METHOD ResetTransform () AS GpStatus |
参数
该方法没有参数.
返回值
如果该方法成功,则返回Ok,这是对Status枚举元素.
如果这个方法失败,它返回一个枚举的其他元素的Status.
引用文件
CGpBrush.inc (include CGdiPlus.inc)
示例
' ========================================================================================
' The following example creates a texture brush and sets the transformation of the brush.
' Next, the code uses the transformed brush to fill a rectangle. Then, the code resets the
' transformation of the brush and uses the untransformed brush to fill a rectangle.
' ========================================================================================
SUB Example_ResetTransform (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 texture brush, and set its transformation.
DIM pImage AS CGpImage = "HouseAndTree.gif"
DIM textureBrush AS CGpTextureBrush = @pImage
textureBrush.RotateTransform(30)
' // Fill a rectangle with the transformed texture brush.
graphics.FillEllipse(@textureBrush, 0, 0, 200, 100)
' // Reset the transformation
textureBrush.ResetTransform
' // Fill a rectangle with the texture brush (no transformation).
graphics.FillEllipse(@textureBrush, 210, 0, 200, 100)
END SUB
' ========================================================================================