Object Model Reference : Classes : C : Color : Methods : Color.RegistrationAssign |
Sub RegistrationAssign()
Member of Color
The RegistrationAssign method sssigns the registration color model, which allows color trapping in CorelDRAW. Color trapping is necessary to compensate for poor color registration that occurs when the printing plates used to print each color, called color separations, are not aligned perfectly. Poor registration causes unintentional white slivers to appear between adjoining colors. Trapping is accomplished by intentionally overlapping colors so that minor problems with alignment are not noticed.
Color trapping is achieved by overprinting. Usually, portions of an object that are obscured by another object are not printed. However, if the top object is set to overprint, the obscured portions of any underlying objects print anyway, causing an overlap. This makes white gaps between different colors unlikely. Overprinting works best when the top color is much darker than the underlying color; otherwise, an undesirable third color may result (for example, red over yellow may result in an orange object).
The following VBA example builds crop marks around selected objects and sets their outline color to the registration color.
Sub Test() |
Const Offset As Double = 1 ' Crop mark offset |
Const Length As Double = 5 ' Crop mark length |
Dim s As Shape |
Dim r As New ShapeRange |
Dim lyr As Layer |
Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double |
Set s = ActiveSelection |
Set lyr = ActiveDocument.ActiveLayer |
ActiveDocument.Unit = cdrMillimeter |
ActiveDocument.ReferencePoint = cdrTopLeft |
x1 = s.PositionX |
y1 = s.PositionY |
ActiveDocument.ReferencePoint = cdrBottomRight |
x2 = s.PositionX |
y2 = s.PositionY |
r.Add lyr.CreateLineSegment(x1 - Length - Offset, y1, x1 - Offset, y1) |
r.Add lyr.CreateLineSegment(x1, y1 + Length + Offset, x1, y1 + Offset) |
r.Add lyr.CreateLineSegment(x2 + Offset, y1, x2 + Length + Offset, y1) |
r.Add lyr.CreateLineSegment(x2, y1 + Length + Offset, x2, y1 + Offset) |
r.Add lyr.CreateLineSegment(x1 - Length - Offset, y2, x1 - Offset, y2) |
r.Add lyr.CreateLineSegment(x1, y2 - Length - Offset, x1, y2 - Offset) |
r.Add lyr.CreateLineSegment(x2 + Offset, y2, x2 + Length + Offset, y2) |
r.Add lyr.CreateLineSegment(x2, y2 - Length - Offset, x2, y2 - Offset) |
For Each s In r |
s.Outline.Width = 0.1 |
s.Outline.Color.RegistrationAssign |
Next s |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.