|Function||Initialize the global variables used by the plotting functions|
|Syntax C/C++||#include <Vgraph.h>
void V_initPlot( HWND vwindow, HDC vdc );
void V_initPlot( int graphmode );
procedure V_initPlot( VPaintBox: TPaintBox );
for Borland Pascal:
procedure V_initPlot( vwindow:HWND; vdc:HDC );
procedure V_initPlot( graphmode:Integer );
|Description||DOS programs: If the graphics system has been initialized by a call to initgraph, V_initPlot is used to initialize the global constants necessary for the operation of the VectorLib plotting functions like VF_xyAutoPlot. If the graphics system is not yet initialized, use V_initGraph to initialize both the basic graphics system and the plotting functions; a call to V_initPlot is not necessary then. graphmode is the graphics mode set by initgraph.
C/C++ and Pascal Windows programs:
vwindow is the handle for a window and vdc the handle of a device context. As long as these handles remain valid, future plotting operations (like VF_xyAutoPlot) will be directed to the window specified by vwindow and use the fonts defined in the device context vdc. Be sure that vwindow and vdc are still valid when a plotting operation is performed; if in doubt, call V_initPlot again. The natural place to call V_initPlot is in the virtual element function Paint. Then, the handle of the actual window is made available as "HWindow" by OWL, and the device context is the same as passed as a parameter to Paint.
VPaintBox is the paint box into which you wish to get a VectorLib plot. All future VectorLib plotting operations are directed into this paint box, unless you call V_initPlot again, with a new paint box as parameter.
all targets (DOS and Windows):
V_initPlot reserves the rightmost about 2/3 of the screen for following plotting operations, leaving one line empty at the top of the screen and a few lines at the bottom. To override this, call V_setPlotRegion after V_initPlot.
VectorLib Table of Contents OptiVec home