Previous Document Next Document
Fill.ApplyPatternFill

Function ApplyPatternFill(Type As cdrPatternFillType, [FileName As String], [PatternCanvasIndex As Long = 1], [FrontColor As Color], [EndColor As Color], [TransformWithShape As Boolean = False]) As PatternFill

Member of Fill

The ApplyPatternFill method applies a pattern fill to a shape. There are three types of pattern fills: two-color, full-color vector, and bitmapped.

Parameters
Description
Type
Specifies the type of the pattern fill and returns a value of cdrPatternFillType
FileName
Specifies the full path and filename of the graphic that is imported as a pattern fill
This parameter is optional.
PatternCanvasIndex
Specifies the pattern canvas by its index number
This parameter is optional, and its default value is 1.
FrontColor
Specifies the foreground color in a pattern fill
This parameter is optional, and its default value is Nothing.
EndColor
Specifies the background color in a pattern fill
This parameter is optional, and its default value is Nothing.
TransformWithShape
Determines whether the pattern fill changes according to transformations in the shape object
This parameter is optional, and its default value is False.

The following code example creates a rectangle and applies a bitmap pattern fill to it:

Sub Test() 
 Dim s As Shape 
 Set s = ActiveLayer.CreateRectangle(0, 0, 5, 5) 
 s.Fill.ApplyPatternFill cdrBitmapPattern, Application.Path + 
"Custom Data\Canvas\breadc.pcx" 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.