Previous Document Next Document

Object Model Reference : Classes : T : TextureFillProperties : Properties : TextureFillProperties.Item


TextureFillProperties.Item

Property Item(IndexOrName As Variant) As TextureFillProperty

Description

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.

Parameter
Description
IndexOrName
Specifies the texture-fill property by its index number or name:
 
Index — Specifies the preset placeholder that uniquely identifies each member of the TextureFillProperties collection
 
Name — Specifies the string that uniquely identifies each texture-fill property

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.