[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jun 29 08:47:32 1999 
Subject:Re: solid polygons (Was: soild polygons) 
From:Aaron Sloman See text for reply address 
Volume-ID:990629.05 

Andrew Philip Crook <shu96apc@reading.ac.uk> writes:

> Organization: University of Reading
>
> i wish to do the following any ideas
>
> draw window using rc_gracphic
> set points
> set polygon links
>
> set fill colour
>
> drawfilled polygon (XpwMFillPolygon maybe? looks nasty!)

Use XpwFillPolygon, described in REF XpwPixmap

    XpwFillPolygon(widget, coordlist, shape, drawmode);


You'll have to do your own conversion of coordinates to ensure that
the coordlist (a list or vector of numbers) has pixel coordinates
(integers only) rather than rc_graphic coordinates.

Here's an example to draw a red square near top left of window:

uses rc_graphic

rc_start();

loadinclude XpwPixmap;

'red' -> rc_window(XtN foreground);

XpwFillPolygon(rc_window, [20 20 20 40 40 40 40 20 20 20], Complex, CoordModeOrigin);

I guess I should extend rclib with an rc_fill_polygon procedure,
and similar procedures for the other utilities described in
REF XpwPixmap

Aaron
-- 
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk   (NB: Anti Spam address)
PAPERS: ftp://ftp.cs.bham.ac.uk/pub/groups/cog_affect/0-INDEX.html