Previous Document Next Document

Object Model Reference : Classes : F : FountainColors : Properties : FountainColors.GrayLevel


FountainColors.GrayLevel

Property GrayLevel(Index As Long) As Long

Description

Member of FountainColors

The GrayLevel property returns or specifies the gray level of the specified color point. It is also useful for specifying the transparency level for a fountain transparency.

The index can range from 0 to (Count+1), where GrayLevel(0) represents the starting point and GrayLevel(Count+1) represents the ending color point of the fountain fill or transparency.

Parameter
Description
Index
Specifies the color point by its index number

VBA example

The following VBA example displays the number of points in the fountain transparency of the active shape. The points that are counted must have a transparency level of at least 50%.

Sub Test()
 Dim ff As FountainFill
 Dim t As Transparency
 Dim n As Long, i As Long
 Set t = ActiveShape.Transparency
 If t.Type = cdrFountainTransparency Then
  Set ff = t.Fountain
  n = 0
  For i = 1 To ff.Colors.Count
   If ff.Colors.GrayLevel(i) < 128 Then n = n + 1
  Next i
  MsgBox "The current shape has " & n & " transparency points with 50% or greater transparency level."
 Else
  MsgBox "The shape doesn't have a fountain transparency."
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.