#include "ltwrappr.h"
virtual L_INT LAnnotation::SetROP2(uROP2=ANNROP2_COPY, uFlags=0)
L_UINT uROP2; |
/* the ROP code for display */ |
L_UINT uFlags; |
/* flags that determine which objects to process */ |
Sets the binary raster operation (ROP2) code for one or more annotation objects.
Parameter |
Description |
|
uROP2 |
Constant that specifies the ROP2 code for one or more objects. ROP2 codes specify how pen or brush colors are to be combined with the colors in the image. Possible ROP2 code values are: |
|
|
Value |
Meaning |
|
ANNROP2_COPY |
[0x0000] Draw the object using the object's color |
|
ANNROP2_AND |
[0x0001] Draw the object, performing an AND operation using the object's color and the background color. This creates a highlight effect. White objects become transparent. |
|
ANNROP2_XOR |
[0x0002]Draw the object, performing an XOR operation using the object's color and the background color. This creates an inverted effect. Black objects become transparent. |
|
The default value is ANNROP2_COPY. |
|
|
Default is ANNROP2_COPY. |
|
uFlags |
Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values: |
|
|
Value |
Meaning |
|
0 |
Process only the specified object. |
|
ANNFLAG_SELECTED |
[0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions. |
|
ANNFLAG_NOTTHIS |
[0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not. |
|
ANNFLAG_RECURSE |
[0x0008] Process objects within a container, and within any subcontainers, down to any level. |
|
ANNFLAG_NOTCONTAINER |
[0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves. |
|
ANNFLAG_NOINVALIDATE |
[0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
LAnnotation::SetROP2 can turn a simple rectangle into a hilite-type object. This is the only way to have a hilite object that has different colors for border and interior. To do that, draw a rectangle with a thick border, choose different foreground and background colors (LAnnRectangle::SetForeColor and LAnnRectangle::SetBackColor), and call this function with uROP2 set to ANNROP2_AND.
LAnnotation::SetROP2 is valid only for the following object types:
ANNOBJECT_CROSSPRODUCT
ANNOBJECT_CURVE
ANNOBJECT_CURVECLOSED
ANNOBJECT_ELLIPSE
ANNOBJECT_FREEHAND
ANNOBJECT_FREEHANDHOTSPOT
ANNOBJECT_LINE
ANNOBJECT_POINTER
ANNOBJECT_POINT
ANNOBJECT_POLYGON
ANNOBJECT_POLYLINE
ANNOBJECT_POLYRULER
ANNOBJECT_PROTRACTOR
ANNOBJECT_RECT
ANNOBJECT_RULER
ANNOBJECT_STAMP
ANNOBJECT_TEXTPOINTER
In addition, the Automation object (ANNOBJECT_AUTOMATION) stores default ROP2 settings along with the other object default settings.
Note that the LAnnotation::SetROP2 function and the following functions affect each other:
LAnnText::SetFillMode .
LAnnStamp::SetFillMode .
LAnnPolygon::SetFillMode .
LAnnRectangle::SetFillMode .
LAnnotation::SetFillMode
If you set uFillMode to ANNMODE_OPAQUE, then uROP2 cannot be ANNROP2_AND. If you set uFillMode to ANNMODE_TRANSLUCENT, then uROP2 has to be ANNROP2_AND. If you set uFillMode to ANNMODE_TRANSPARENT, uROP2 can be anything.
This function applies to multiple and selected objects based on values of the uFlags parameter.
Use the LAnnotation::GetROP2 function to obtain the ROP2 code being used for one or more annotation objects.
When working with automated annotations, note that it is possible to change the color of the pen that is used for highlighting and selecting by using the LAnnAutomation::SetAutoHilightPen function for that automation object.
Required DLLs and Libraries
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
See Also
Example
For an example, refer to LAnnotation::GetROP2.