导航:  GdiPlus Classes > GdiPlus Classes > CGpBrush Class > CGpTextureBrush Class > TextureBrush Object >

TranslateTransform

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

描述

 

更新该刷的当前变换矩阵的产品本身和翻译矩阵.

 

C++ Syntax

 

Status TranslateTransform(

[in]  REAL dx,

[in]  REAL dy,

[in]  MatrixOrder order

);

 

FreeBASIC 语法

 

FUNCTION TranslateTransform ( _

   BYVAL dx AS SINGLE, _

   BYVAL dy AS SINGLE, _

   sBYVAL order AS MatrixOrder = MatrixOrderPrepend _

) AS GpStatus

 

参数

 

dx

 

[in]单精度数指定翻译的水平分量.

 

dy

 

[in]单精度数指定翻译的垂直分量.

 

order

 

MatrixOrder指定相乘的顺序[in, optional]元.MatrixOrderPrepend指定传递矩阵是在左边,和MatrixOrderAppend指定传递矩阵是正确的.默认值是MatrixOrderPrepend.

 

返回值

 

如果该方法成功,则返回Ok,这是对Status枚举元素.

如果这个方法失败,它返回一个枚举的其他元素的Status.

 

引用文件

 

CGpBrush.inc (include CGdiPlus.inc)

 

示例

 

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

' The following example creates a texture brush and sets the transformation of the brush.

' The code then uses the transformed brush to fill a rectangle.

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

SUB Example_TranslateTransform (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.TranslateTransform(30, 0, MatrixOrderAppend)

  graphics.FillEllipse(@textureBrush, 0, 0, 400, 200)

 

END SUB

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