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

Constructors

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

描述

 

获取由该纹理画笔定义的图像对象的指针.

 

FreeBASIC 语法

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL nWrapMode AS WrapMode = WrapModeTile _

)

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL dstRect AS GpRectF PTR, _

   BYVAL pImageAttributes AS CGpImageAttributes PTR = NULL _

)

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL dstRect AS GpRect PTR, _

   BYVAL pImageAttributes AS CGpImageAttributes PTR = NULL _

)

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL nWrapMode AS WrapMode, _

   BYVAL dstRect AS GpRect PTR _

)

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL nWrapMode AS WrapMode, _

   BYVAL dstX AS SINGLE, _

   BYVAL dstY AS SINGLE, _

   BYVAL dstWidth AS SINGLE, _

   BYVAL dstHeight AS SINGLE _

)

 

CONSTRUCTOR CGpTextureBrush ( _

   BYVAL pImage AS CGpImage PTR, _

   BYVAL nWrapMode AS WrapMode, _

   BYVAL dstX AS INT_, _

   BYVAL dstY AS INT_, _

   BYVAL dstWidth AS INT_, _

   BYVAL dstHeight AS INT_ _

)

 

参数

 

pImage

 

指向接受该纹理画笔定义的图像对象的指针的指针.

 

nWrapMode

 

元的WrapMode枚举指定如何重复拷贝的图像是用于瓷砖面积时,涂上这个纹理刷.

 

dstX

 

图像的部分被这个刷用左边的坐标.

 

dstY

 

此画笔使用的图像部分的最上面的坐标.

 

dstWidth

 

画笔的宽度和画笔要使用的图像部分的宽度.

 

dstHeight

 

画笔的高度和画笔要使用的图像部分的高度.

 

Status value (GetLastStatus)

 

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

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

 

备注

 

The dstX, dstY, dstWidth, and dstHeight parameters specify a rectangle. The size of the brush is defined by dstWidth and dstHeight. The dstX and dstY parameters have no affect on the brush's size or position ?the brush is always oriented at (0, 0). The dstX, dstY, dstWidth, and dstHeight parameters define the portion of the image to be used by the brush.

 

For example, suppose you have an image that is stored in an Image object and is 256 ?12 (width 議eight) pixels. Then you create a TextureBrush object based on this image as follows:

 

TextureBrush(@someImage, WrapModeTile, 12, 50, 100, 150)

 

The brush will have a width of 100 units and a height of 150 units. The brush will use a rectangular portion of the image. This portion begins at the pixel having coordinates (12, 50). The width and height of the portion are 100 and 150, respectively, measured from the starting pixel.

 

Now suppose you create another TextureBrush object based on the same image and specify a different rectangle:

 

TextureBrush(@someImage, WrapModeTile, 0, 0, 256, 512)

 

The brush will have width and height equal to 256 and 512, respectively. The brush will use the entire image instead of a portion of it because the rectangle specifies a starting pixel at coordinates (0, 0) and dimensions identical to those of the image.

 

引用文件

 

CGpBrush.inc (include CGdiPlus.inc)