Admin Production ni-theme
Current Publication

CanvasDrawRoundedRect

LabWindows/CVI

CanvasDrawRoundedRect

int CanvasDrawRoundedRect (int panelHandle, int controlID, Rect rectangle, int ovalHeight, int ovalWidth, int drawMode);

Purpose

Draws a rounded rectangle on the canvas control at the position and with the dimensions specified by the rect parameter. Each corner of the rectangle is drawn as a quadrant of an oval.

CanvasDrawRoundedRect draws the frame of the rectangle using the current value of the following attributes:

ATTR_PEN_COLOR
ATTR_PEN_MODE
ATTR_PEN_WIDTH
ATTR_PEN_STYLE
(ignored when pen width is greater than one)

CanvasDrawRoundedRect draws the interior of the rectangle using the current value of the following attributes:

ATTR_PEN_FILL_COLOR
ATTR_PEN_MODE
ATTR_PEN_PATTERN

Supported Controls

You can use CanvasDrawRoundedRect 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.
rectangle Rect Rect structure specifying the location and size of the rectangle to be drawn.

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

CanvasDrawRoundedRect (panelHandle, controlID, MakeRect(20,30,150,200), 5, 5, VAL_DRAW_FRAME);

ovalHeight int Vertical diameter of the oval whose quadrants are drawn at the corners of the rounded rectangle.
ovalWidth int Horizontal diameter of the oval whose quadrants are drawn at the corners of the rounded rectangle.
drawMode int Specifies whether to draw the rectangle frame, or interior, or both. The following lists the valid values:

VAL_DRAW_FRAME
VAL_DRAW_INTERIOR
VAL_DRAW_FRAME_AND_INTERIOR

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