VectorOutputID = WindowVectorOutput(#Window [, Unit])
Returns the OutputID of the given window to perform vector drawing operations. It will use the PureBasic VectorDrawing library and can only be used within a StartVectorDrawing() / StopVectorDrawing() block. The memory allocated in WindowVectorOutput() is released on StopVectorDrawing().


#Window The window to use.
Unit (optional) Specifies the unit used for measuring distances on the drawing output. The default unit for windows is #PB_Unit_Pixel.
  #PB_Unit_Pixel     : Values are measured in pixels (or dots in case of a printer)
  #PB_Unit_Point     : Values are measured in points (1/72 inch)
  #PB_Unit_Inch      : Values are measured in inches
  #PB_Unit_Millimeter: Values are measured in millimeters

Return value

The OutputID of the given window to perform 2D rendering operation on it using StartVectorDrawing().


Content drawn on a window will be erased whenever the window or a part of it is covered by another window, moved outside of the screen or when the window is hidden or minimized. So to keep the drawn content visible, it must be redrawn after every #PB_Event_Repaint event. A more convenient alternative is to draw the content to an image via ImageVectorOutput() and display it as ImageGadget() in the application window and if necessary, update it with SetGadgetState(). This way all needed refreshing will be handled by the ImageGadget.

See Also

StartVectorDrawing(), WindowOutput()

Supported OS


<- WindowOutput() - Window Index - WindowWidth() ->