【CorelDraw VBA 013例】创建圆角矩形轮廓


Sub CreateSign()
    '##创建圆角矩形轮廓
    Dim s As Shape
    Dim sFirstContour As Shape, sSecondContour As Shape
    Dim srContours As New ShapeRange
    ActiveDocument.Unit = cdrMillimeter
    Set s = ActiveLayer.CreateRectangle2(0, 0, 600, 600) 'Create the outside shape
    s.Fillet 40, True 'Apply the Radius to each corner
    Set sFirstContour = s.CreateContour(cdrContourInside, 8, 1).Separate(1) 'Create the first inner contour shape
    Set sSecondContour = sFirstContour.CreateContour(cdrContourInside, 16, 1).Separate(1) 'Create the second inner contour shape
    srContours.Add sFirstContour 'Add contour to shaperange
    srContours.Add sSecondContour
    Set s = srContours.Combine 'Combine shaperange into single shape
    s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 'Fill with
End Sub