Previous Document Next Document
Shape.CreateEnvelope

Function CreateEnvelope(PresetIndex As Long, [Mode As cdrEnvelopeMode = cdrEnvelopePutty], [KeepLines As Boolean = False]) As Effect

Member of Shape

The CreateEnvelope method inserts a shape into a preset envelope. This method returns an Effect object that represents the envelope-effect properties.

Currently you can apply only a preset envelope shape, and node positions cannot be modified.

Parameters
Description
PresetIndex
Represents an index number that uniquely identifies a preset envelope effect
Mode
Specifies the type of mapping mode for the envelope effect. The Mode property returns a value of cdrEnvelopeMode.
This parameter is optional, and its default value is cdrEnvelopePutty (2).
KeepLines
Determines whether an envelope effect keeps its lines straight or converts them to curves. If the KeepLines property is True, the envelope effect keeps its lines straight.
This parameter is optional, and its default value is False.

The following code example draws a magnifying glass:

Sub Test() 
 Dim sText As Shape, sRect As Shape, sCircle1 As Shape, sCircle2 As 
Shape 
 Set sText = ActiveLayer.CreateArtisticText(2.8, 7.5, "Magnify") 
 With sText.Text.FontProperties 
  .Name = "Arial" 
  .Size = 64 
 End With 
 sText.Text.AlignProperties.Alignment = cdrCenterAlignment 
 sText.CreateEnvelope 4, cdrEnvelopePutty, False 
 ActiveDocument.ReferencePoint = cdrCenter 
 sText.Stretch 1, 1.6 
 Set sRect = ActiveLayer.CreateRectangle(2.164134, 5.358543, 
6.338504, 4.798346) 
 With sRect 
  With .Fill.ApplyFountainFill(CreateRGBColor(255, 0, 0), 
CreateRGBColor(251, 0, 81), , -90) 
   .Colors.Add CreateRGBColor(255, 0, 0), 1 
   .Colors.Add CreateRGBColor(253, 253, 213), 23 
   .StartX = 4.251319 
   .StartY = 5.358543 
   .EndX = 4.251319 
   .EndY = 4.798346 
  End With 
  .Rotate -60 
  .Move 0.469843, -0.397559 
  .Outline.Type = cdrNoOutline 
 End With 
 Set sCircle1 = ActiveLayer.CreateEllipse(1.116024, 9.514843, 
4.459134, 6.171732) 
 sCircle1.Outline.SetProperties 0.3, OutlineStyles(0), 
CreateCMYKColor(0, 100, 100, 0) 
 Set sCircle2 = sCircle1.Duplicate 
 With sCircle2.Outline 
  .Width = 0.05 
  .Color.CMYKAssign 0, 0, 0, 0 
 End With 
 sCircle2.CreateBlend sCircle1 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.