Admin Production ni-theme
Current Publication

PlotBitmap

LabWindows/CVI

PlotBitmap

int PlotBitmap (int panelHandle, int controlID, double x, double y, double width, double height, char filename[]);

Purpose

Plots a bitmapped image from a file onto a graph control.

The origin of the image is expressed in terms of the x and y coordinates of the graph. The origin pinpoints the lower left corner of the image.

Supported Controls

You can use PlotBitmap with graph 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.
x double X-coordinate of the lower left corner of the bitmapped image.
y double Y-coordinate of the lower left corner of the bitmapped image.
width double Width, in graph units, of the area in which to fit the bitmapped image. If zero, then the width is the width of the image. If nonzero, the image stretches or shrinks to fit.

When nonzero, width should be positive. If width is negative, the function interprets x as applying to the right edge instead of the left edge of the image.
height double Height, in graph units, of the area in which to fit the bitmap image. If zero, then the height is the height of the image. If nonzero, the image stretches or shrinks to fit.

When nonzero, height should be positive. If height is negative, the function interprets y as applying to the top edge instead of the bottom edge of the image.
filename char [] Name of the file that contains the image.

filename can be a complete pathname or a simple filename. For simple filenames that contain no directory path, the file is loaded from the directory that contains the executable.

Valid image types are .tif, .pcx, .bmp, .dib, .rle, .ico, .jpg, .png, .wmf, and .emf.

(Linux) Valid image types are .pcx, .jpg, and .xwd.

You can pass NULL or an empty string for filename. This capability is useful when you want to define the image at a later point in your program by calling SetCtrlBitmap on the plot handle this function returns. The plot is not visible until you specify a valid image.

Return Value

Name Type Description
plotHandle int The handle of the new plot that you can use in subsequent function calls to reference the plot.

If the handle is positive, the new plot was successfully added to the graph. Negative values indicate that an error occurred.

Note  If ATTR_DATA_MODE is set to VAL_DISCARD, the function returns 0.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Example

Refer to userint\graphlegend.cws for an example of using the PlotBitmap function.