Use this to attach other handlers, eg for w32HMouse, or w32HKeyPress etc.
The handler is attached to the shadow Bitmap object as it seemed to me at the time
that Pixmaps don't receive events.
See Also: gfxClear, gfxDestroy, gfxScaleShape, gfx_draw, newGfx
colour can be any colour win32lib can handle
gfx can be an integer to the index of the gfx (TODO gfxIndex) or an actual gfx.
You can also pass -1 for the gfx to clear all known gfx objects.
See Also: gfxAttachHandler, gfxDestroy, gfxScaleShape, gfx_draw, newGfx
Destroys all controls associated with the gfx and removes it from the global gfxs sequence
See Also: gfxAttachHandler, gfxClear, gfxScaleShape, gfx_draw, newGfx
This function scales a shape and returns the scaled shape.
Although it can accept a fractional scale it works best with integers as scaling
the types of shapes this system uses results in integer roundings which alter the
intent of the original shape. Just try it and see :)
See Also: gfxAttachHandler, gfxClear, gfxDestroy, gfx_draw, newGfx
This is the gateway to drawing on the gfx.
It takes the gfx you want to draw on, the type of primitive you want to draw
the colour and a sequence appropriate for the primitive type. The primitive type is a string description, eg "line", "ellipse", etc. And will eventually mirror the types of
primitive that win32lib has to offer.
Primitive types:
"rect-solid" - points is {x1, y1, x2, y2} - draws a solid rectangle in colour
"rect" - points is {x1, y1, x2, y2} - draws a rectangle outline in colour
"line" - points is {x1, y1, x2, y2} - draws a line in colour from x1,y1 to x2,y2
"ellipse" - points is {x1, y1, x2, y2} - draws an ellipse outline in colour bounded by x1,x2,y1,y2
"ellipse-solid" - points is {x1, y1, x2, y2} - draws a solid ellipse
"shape" - points is {x1, y1, {delta_x, delta_y, pen_status}, ...}
A shape starts at x1, y1 and moves through the remaining deltas either drawing a line or not depending on pen_status True or False.
"shape-test" is like "shape" but uses two colours for colour in the form {colour1, colour2}. If the Pen is Up then it uses colour1, if it is down it uses colour2. The reason this is here is for demo2-shapes.exw and allows drawing of the shape in a away that shows the different pen status of each segment.
the generalised drawing procedure
See Also: gfxAttachHandler, gfxClear, gfxDestroy, gfxScaleShape, newGfx
This function handles creating all the background things needed for double buffered
drawing within win32lib. Once you have a gfx object you can draw things on it.
gfx_draw handles most of the drawing (though you can use gfxBuf to get a handle to the offscreen buffer to draw what you want).
parent_id is the control that the gfx is created in. It will usually be a win32lib id from creating a window.
at_x, at_y is the point within the parent_id the gfx will display
width, height is the size, in pixels, of the gfx object
If you have called setGfxAutoPaint as true then anything you draw will automatically be drawn. Otherwise when all the drawing is done call doGfxPaint and all your drawing in that cycle will be rendered on screen.
Note that when you create a new gfx you probably won't see it on screen because it
will be the same colour as the window's default background colour. Call gfxClear to
clear it to a different colour.
See Also: gfxAttachHandler, gfxClear, gfxDestroy, gfxScaleShape, gfx_draw