From 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 17 Oct 2008 06:10:33 +0000 Subject: First commit - moving from LuaForge to SourceForge --- html/en/canvas.html | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 html/en/canvas.html (limited to 'html/en/canvas.html') diff --git a/html/en/canvas.html b/html/en/canvas.html new file mode 100644 index 0000000..dc7721b --- /dev/null +++ b/html/en/canvas.html @@ -0,0 +1,47 @@ + + + + + +Canvas + + + + +

Canvas

+ +

The canvas represents the drawing surface. It could be anything: a file, a + client area inside a window in a Window System, a paper used by a printer, + etc. Each canvas has its own attributes.

+

Initialization

+

You must call cdCreateCanvas to create a canvas, and cdKillCanvas when you do not need the canvas anymore. + It is not necessary to activate + a canvas using cdCanvasActivate, but some drivers may require that + call.

+

To know if a feature is supported by a driver, use function + cdContextCaps or see the driver's + documentation.

+

Control

+

Some canvases are buffered and need to be flushed; for that, use the cdCanvasFlush function. In some drivers, this function can also be used to + change to another page, as in drivers CD_PRINTER  and CD_PS. +

+

You can clear the drawing surface with the cdCanvasClear function, + but in some drivers the function may just draw a rectangle using the + background color.

+

Coordinate System

+

You may retrieve the original canvas size using the cdCanvasGetSize + function. The canvas' origin is at the bottom left corner of the canvas, but + an origin change can be simulated with function cdCanvasOrigin. Usually + user interface libraries have their origin at the upper right corner, oriented + top down. In this case, the function cdCanvasUpdateYAxis + converts the Y coordinate from this orientation to CD's orientation and + vice-versa.

+

Other

+

Some canvas contents can be interpreted; the cdCanvasPlay function + interprets the contents of a canvas and calls library functions for the + contents to be displayed in the active canvas.

+ + + + + -- cgit v1.2.3