Documentation for graphex.ew v0.10.5
Table of Contents

Drawing

Information about the gfx_draw(..) routine.


  • proc gfx_draw(gfx, primitive_type, colour, points)   The main generalised drawing procedure
  • const GP_*   GP are constants for "graphex primitives"

    Documentation for graphex.ew v0.10.5
    Table of Contents

    [proc]
    gfx_draw
    (gfx, primitive_type, colour, points)

    The main generalised drawing procedure

    Category: Drawing

    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 constant, eg GP_LINE, GP_ELLIPSE, etc.
    See the primitive type constants GP_*

    See Also: GP_*


    Documentation for graphex.ew v0.10.5
    Table of Contents

    [const]
    GP_*

    GP are constants for "graphex primitives"

    Category: Drawing


    GP_POINT - A single point of a certain colour, points is {x, y}
    GP_LINE - A line from x1, y1 to x2, y2, points is {x1, y1, x2, y2}
    GP_RECT - An outline rectangle from x1, y1 to x2, y2, points is {x1, y1, x2, y2}
    GP_RECT_SOLID - A filled rectange from points {x1, y1, x2, y2}
    GP_RECT_ROUND - An outline rounded rectangle of x1, y1 to x2, y2 with ellipse corners xc, yc - points is {x1, y1, x2, y2, xc, yc}
    GP_RECT_ROUND_SOLID - A filled round rectangle with points as above
    GP_ELLIPSE - An ellipse with points {x1, y1, x2, y2} - draws an ellipse outline in colour bounded by x1,x2,y1,y2
    GP_ELLIPSE_SOLID - A filled ellipse as per above
    GP_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.
    GP_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
    GP_IMG_SIMPLE - an image loaded with loadBmpFromFile etc (an hDib) where points is {start_x, start_y, hDib, width, height}
    GP_IMG_TRANS - draws an image similar to above but using the transparency colour as defined by setTransparentColour
    GP_IMG_BITBLT - full access to the bitBlt function, params is {dstX, dstY, hDib, srcX, srcY, wide, high, rop}
    GP_IMG_STRETCH - access to the stretchBlt function, params is {dstX, dstY, hDib, dstWide, dstHigh, src, srcX, srcY, srcWide, srcHigh, rop}

    When adding new constants the range from GP_POINT to GP_ELLIPSE_SOLID is tested for the types of shapes that specify {start_x, start_y, end_x, end_y}. Anything after GP_SHAPE_TEST is assumed to be of {start_x, start_y, width, height} form.

    See Also: gfx_draw