StartDrawing()
Syntax
Result = StartDrawing(OutputID)Description
Change the current drawing output to the specified output. After setting this, all the Drawing commands are rendered to this output. Once all drawing operations are finished, StopDrawing() must be called.
The 'Result' should be always tested before continue with drawing operations. If the 'Result' is zero, then the output can't be used for drawing, else it's ok.
The back color is set to black (ie: RGB(0,0,0)) and the front color is set to white (ie: RGB(255,255,255)).
OutputID can be obtained with the following commands:WindowOutput() : Graphics will be rendered directly on the Window ScreenOutput() : Graphics will be rendered directly on the Screen (for games) SpriteOutput() : Graphics will be rendered directly on the Sprite (for games) ImageOutput() : Graphics will be rendered directly on the Image data (see CreateImage()) PrinterOutput() : Graphics will be rendered directly on the Printer TextureOutput() : Graphics will be rendered directly on the TextureFor drawing operations, the following commands are available:Box() : Box Circle() : Circle Ellipse() : Ellipse FillArea() : Fill function Line() : Line (width and height) LineXY() : Line (x1,y1 to x2,y2) Plot() : Point DrawImage() : Display an existing image DrawText() : Text output DrawingBuffer() : direct access to the screen buffer for fast graphic effects (Windows and Linux only)Note: Under Windows it is required to manually redraw the graphics - painted with WindowOutput() directly in a window - after each covering, minimizing etc. of the window. It's therefore recommended to draw graphics via ImageOutput() on an image and display it as ImageGadget() in the application window and if necessary update it with SetGadgetState(). Windows will then refresh the graphics automatically.
The 'Result' value is the DC (Device Context) handle which can be required by some WindowsAPI functions.
Supported OS
All