Command
QisLib_Redraw

QisLib_Redraw


Function:
	int QisLib_Redraw(CQisWindow* WindowExts, int* ImageSize, const char** ImageBuffer,
	int ClearDrawWindow);

Inputs:
	WindowExts :Address of buffer to retrieve window extents corresponding to the image.
	ImageSize :Address of buffer to retrieve the size of the buffer pointed to by
	ImageBuffer in bytes.
	ImageBuffer :Address of pointer of type char*. When the function returns successfully,
	this pointer will point to the image data or may be invalid depending on certain
	conditions.
	ClearDrawWindow :Instructs QisLib to clear the drawing area before a redraw when
	QisLib_SetDrawWindowID is turned on. It can be _QIS_ON (On) or _QIS_OFF (Off).

Return:
	success: 0
	special: 1 indicates that drawing finished successfully but no image was returned via
	ImageBuffer. (QisLib_SetImageFormat is off or QisLib_SetDrawWindowID is on)
	failure: one of the following values:

Errors:
	-1: QisLib has not been initialized. On Unix/Linux, this error could also mean that
	the DisplayHandle parameter of QisLib_InitLib has been set to NULL.
	-2: File open in progress, operation not permitted.

Description:
	- This is the primary function responsible for drawing.
	- On Unix/Linux, this function does nothing if the 'DisplayHandle' parameter was set
	to NULL in QisLib_InitLib.
	- If QisLib_SetDrawWindowID is off and QisLib_SetImageFormat is not off, this function
	returns image data via the ImageBuffer pointer. The image is based on various
	settings such as viewing window, display filters, color settings, layers on/off, etc.
	- The format of the image data (GIF, Bitmap or Xpm) depends on the
	QisLib_SetImageFormat setting (GIF by default). If QisLib_SetImageFormat is off, no
	image is returned and ImageBuffer is invalid and should not be used.
	- If QisLib_SetDrawWindowID is on, this function draws an image directly to the user
	program's drawing area. No image data is returned via ImageBuffer and ImageBuffer
	should not be used when this function returns. This function returns 1 indicating
	that QisLib has finished drawing to the user's program drawing area successfully
	but ImageSize and ImageBuffer are invalid and should not be used. If 'WindowExts'
	is not NULL, it will point to the window extents corresponding to the image.
	- If QisLib_SetDrawWindowID is on, the ClearDrawWindow parameter instructs QisLib to
	clear the drawing area using the background color before drawing (ClearDrawWindow =
	1) or overlay the new image onto the image in the user program's drawing area
	(ClearDrawWindow = 0). The ClearDrawWindow parameter is ignored if
	QisLib_SetDrawWindowID is off.
	- If the user program wants to stop the drawing before this function finishes drawing
	and returns, use QisLib_Stop. To use this feature, however, QisLib_SetProcessEvents
	must be turned on. For Unix/Linux, the program's application context must also be
	passed to QisLib_InitLib.
	- If the redraw is stopped using QisLib_Stop, and QisLib_SetDrawWindowID is off,
	QisLib_Redraw still returns a partially finished image that can be either used or
	discarded by the user program.
	- To get a partial image while QisLib_Redraw is in progress, call QisLib_GetImage.
	Just like QisLib_Stop, QisLib_SetProcessEvents must be turned on. For Unix/Linux,
	the program's application context must also be passed to QisLib_InitLib. Also
	QisLib_SetDrawWindowID must be off.
	- Window, ImageSize and ImageBuffer can be selectively passed as NULL depending on
	what information the user program wishes to retrieve. If all of them are set to
	NULL, and QisLib_SetDrawWindowID is off, QisLib_Redraw simply draws to the internal
	drawing area inside QisLib.
	- The resolution of the image in pixels generated by QisLib_Redraw can be specified by
	QisLib_SetImageSize. If QisLib_SetDrawWindowID is on, the resolution of the user's
	program drawing area in pixels should be specified by QisLib_SetImageSize.

References:
QisLib_SetImageFormat
QisLib_SetImageSize
QisLib_SetDrawWindowID
QisLib_GetImage
QisLib_Stop
QisLib_SetProcessEvents
QisLib_InitLib
CQisWindow