Object Model Reference : Classes : T : TextureFillProperties : Properties : TextureFillProperties.Item |
Property Item(IndexOrName As Variant) As TextureFillProperty
Member of TextureFillProperties
The Item property returns a TextureFillProperty object that represents a single parameter of a texture fill. It is the default property of the TextureFillProperties class.
• |
Parameter names are localized in international versions of CorelDRAW. If you
choose to use parameter names, your macros may need to be revised for
localized builds of CorelDRAW.
|
The Item property returns a read-only value.
The following VBA example displays detailed information about the texture fill of a selected shape, including its list of parameters and their values.
Sub Test() |
Dim s As Shape |
Dim tf As TextureFill |
Dim prop As TextureFillProperty |
Dim ss As String, i As Long |
Set s = ActiveShape |
If s Is Nothing Then |
MsgBox "Nothing selected" |
Exit Sub |
End If |
If s.Fill.Type <> cdrTextureFill Then |
MsgBox "Select a shape with texture fill" |
Exit Sub |
End If |
Set tf = s.Fill.Texture |
ss = "Texture Name: " & tf.TextureName & vbCr & "Library Name: " |
If tf.LibraryName = "" Then |
ss = ss & "Styles" |
Else |
ss = ss & tf.LibraryName |
End If |
ss = ss & vbCr & "Style Name: " & tf.StyleName & vbCr |
ss = ss & vbCr & "Parameter: " |
For i = 1 To tf.Properties.Count |
Set prop = tf.Properties(i) |
ss = ss & vbCr & prop.Name & " " |
If prop.Type = cdrTexturePropertyNumeric Then |
ss = ss & prop.Value |
Else |
ss = ss & "Color(" & prop.Value.Name(True) & ")" |
End If |
Next i |
MsgBox ss |
End Sub |
Sub Test() |
Dim s As Shape |
Dim tf As TextureFill |
Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2) |
Set tf = s.Fill.ApplyTextureFill("Dark Cloud", "Samples 8") |
tf.Properties("Texture #:").Value = 78 |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.