Previous Document Next Document
Shape.Trim

Function Trim(TargetShape As Shape, [LeaveSource As Boolean = True], [LeaveTarget As Boolean = False]) As Shape

Member of Shape

The Trim method trims an object.

Parameters
Description
TargetShape
Specifies the object to trim
LeaveSource
Determines whether to keep the object that trims the other object, after the trim is complete
This parameter is optional, and its default value is True.
LeaveTarget
Determines whether to keep the target object after the trim is complete
This parameter is optional, and its default value is False.

The following code example creates text embossed on a texturized surface:

Sub Test() 
 Const Offset As Double = 0.05 
 Dim sBase As Shape, sLight As Shape, sDark As Shape 
 Dim sRect As Shape 
 Set sRect = ActiveLayer.CreateRectangle2(0.75, 4, 7, 3) 
 Set sBase = ActiveLayer.CreateArtisticText(4.25, 4.75, "Bevel") 
 With sBase.Text 
  With .FontProperties 
   .Name = "Arial" 
   .Size = 150 
   .Style = cdrBoldFontStyle 
  End With 
  .AlignProperties.Alignment = cdrCenterAlignment 
 End With 
 Set sLight = sBase.Duplicate(-Offset, Offset) 
 Set sLight = sBase.Trim(sLight) 
 sLight.Fill.UniformColor.CMYKAssign 20, 0, 20, 0 
 Set sDark = sBase.Duplicate(Offset, -Offset) 
 sDark.Fill.UniformColor.CMYKAssign 100, 0, 100, 80 
 sBase.Trim sDark, False, False 
 sRect.Fill.ApplyTextureFill "Ivy on a Wall", "Samples 7" 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.