CanvasDimRect

int CanvasDimRect (int panelHandle, int controlID, Rect rect);

Purpose

Overlays a checkerboard pattern in the specified rectangular area of a canvas control. This pattern has the visual effect of dimming objects within the area.

CanvasDimRect draws the checkerboard pattern using the current value of the ATTR_PEN_FILL_COLOR attribute.

Parameters

Input
Name Type Description
panelHandle integer Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID integer The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
rect Rect Rect structure specifying the location and size of the area to be dimmed. Use VAL_ENTIRE_OBJECT to specify the entire canvas.

The Rect structure is defined as follows:

typedef struct
   {
   int top;
   int left;
   int height;
   int width;
   } Rect;

You can create a Rect without having to declare a variable by using the following function:

Rect MakeRect (int top, int left, int height, int width);

Example

CanvasDimRect (panelHandle, controlID, MakeRect(20,30,150,200));

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx Success