Previous Document Next Document

Object Model Reference : Classes : S : Shape : Methods : Shape.CreateEnvelope


Shape.CreateEnvelope

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

Description

Member of Shape

The CreateEnvelope method inserts a shape into a preset envelope, returning an Effect object that represents the envelope properties.

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

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

VBA example

The following VBA 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 2013 Corel Corporation. All rights reserved.