Previous Document Next Document

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


Shape.Trim

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

Description

Member of Shape

The Trim method trims a shape.

Parameter
Description
TargetShape
Specifies the shape with which to trim
LeaveSource
Specifies whether to keep an original of the trimmed shape. This parameter is optional, and its default value is True.
LeaveTarget
Specifies whether to keep the shape with which the trim was performed. This parameter is optional, and its default value is False.

VBA example

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