OverlayRectangle()

Description

Decorates an image specified by index. The decoration is in the form of rectangles filled with transparent color.

Syntax

.OverlayRectangle(sImageIndex, left, top, right, bottom, color, fOpacity);

Parameters

<short> sImageIndex: specifies the index of image in buffer. The index is 0-based.
<int> left: specifies the x-coordinate of the upper-left corner of the rectangle.
<int> top: specifies the y-coordinate of the upper-left corner of the rectangle.
<int> right: specifies the x-coordinate of the lower-right corner of the rectangle.
<int> bottom: specifies the y-coordinate of the lower-right corner of the rectangle.
<int> color: specifies the color. It is a value specifying the 24-bit RGB value.

Default is white (0xffffff). The byte-ordering of the 24-bit RGB value is BBGGRR. BB represents blue, GG represents green and RR represents red.

<float> fOpacity: specifies the opacity of the color. 1.0 is 100% opaque and 0.0 is totally transparent.

Return value

bool

true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.

Example

DWObject.OverlayRectangle(0, 50, 50, 300, 300, 0xff0000, 0.5);