Admin Production ni-theme
Current Publication

OGLGetScaledCtrlBitmap

LabWindows/CVI

OGLGetScaledCtrlBitmap

int OGLGetScaledCtrlBitmap (int panelHandle, int OGLControlId, int maximumSize, int newWidth, int newHeight, int *bitmapId);

Purpose

Gets a scaled bitmap of the OGL control.

Note  Using the maximum size option results in a request for a large amount of memory. For example, if the maximum sized bitmap happens to be 2000 × 2000 pixels, then the amount of memory requested will be 2000 × 2000 × 3 bytes, which is approximately 12MB of memory.

Parameters

Input
Name Type Description
panelHandle int The specifier for a particular panel that is currently in memory.

This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
OGLControlId int The ID returned by OGLNewCtrl or OGLConvertCtrl.
maximumSize int Specify a nonzero value or select Yes in the function panel to scale the bitmap to the maximum possible resolution based on the currently selected printer. The newWidth and newHeight parameters are ignored if you enable maximum size.

Specify 0 or select No in the function panel to disable using the maximum size.

Note   Turning this flag on causes a request for a large amount of memory. For example, if the maximum sized bitmap is 2000 × 2000 pixels, then the amount of memory requested will be 2000 × 2000 × 3 bytes, which is approximately 12MB of memory.
newWidth int Specifies the desired width of the resultant bitmap.

Use –1 to maintain the same width.
newHeight int Specifies the desired height of the resultant bitmap.

Use –1 to maintain the same height.
Output
Name Type Description
bitmapId int An ID that represents the bitmap created from the current appearance of the control. It can be passed to CanvasDrawBitmap, ClipboardPutBitmap, or any other function that accepts a bitmap.

You can discard the bitmap by passing the ID to the DiscardBitmap function.

Zero is not a valid bitmap ID.

Return Value

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

Error Codes

–1 to –999 A User Interface Library error code. (constants are available in userint.h)
–1001 The panel is a child panel.
–1002 No window system handle for panel.
–1003 Only a canvas or picture can be converted into an OGL control.
–1004 Error registering window.
–1005 Error creating window.
–1006 The OGL control could not be found.
–1007 Too many controls.
–1008 The OGL plot could not be found.
–1009 Too many plots.
–1010 The label attribute could not be obtained.
–1011 Could not hide the control.
–1012 Could not unhide the control.
–1013 Could not move the control.
–1014 Could not resize the control.
–1015 Invalid parameters passed to the function.
–1016 The attribute is an invalid OGL control attribute.
–1017 The attribute is an invalid OGL plot attribute.
–1018 The last operation caused an OpenGL error. Use OGLGetLastOpenGLError to get the error code.
–1019 The last operation caused a Windows error. Use GetLastError to get the error code.
–1020 The font name is too long.
–1021 The attribute value cannot be set.
–1022 Not enough memory.
–1023 Could not set the context.
–1024 Could not restore the context.
–1025 The control was created by another thread.
–1026 The data type passed to this function was invalid.
–1027 Trying to get an uninitialized or zero length array attribute.
–1028 The function has to be called from the main thread.
–1029 The control is already being refreshed.
–1030 The pixel depth cannot be less than 8 bits (256 colors).

Additional Information

Library: OpenGL 3D Plotting Control

Include file: custctrl\cviogl.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later