Admin Production ni-theme
Current Publication

CanvasUpdate

LabWindows/CVI

CanvasUpdate

int CanvasUpdate (int panelHandle, int controlID, Rect updateArea);

Purpose

Immediately updates on the screen the contents of the canvas control within a specific rectangular area.

The canvas control maintains an internal bitmap reflecting all of the drawing operations, except for drawing operations made while the ATTR_DRAW_POLICY attribute is VAL_DIRECT_TO_SCREEN. Maintaining the internal bitmap ensures that the canvas is redrawn correctly when it is exposed.

CanvasUpdate copies the content of the rectangular area in the internal bitmap to the canvas control.

Supported Controls

You can use CanvasUpdate with canvas controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int 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 functions such as NewCtrl and DuplicateCtrl.
updateArea Rect Rect structure specifying the location and size of the rectangular to update from the internal bitmap. Use VAL_ENTIRE_OBJECT to specify the entire canvas control.

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

CanvasUpdate (panelHandle, controlID, VAL_ENTIRE_OBJECT);

Return Value

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

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later