On Sat, 5 Aug 2000, Ben Escoto wrote:

> >>>>> "JH" == James Henstridge <[EMAIL PROTECTED]>
> >>>>> wrote the following on Sat, 5 Aug 2000 17:04:23 +0800 (WST)
> 
>   >>  I would like to fill a GnomeCanvasItem on the GnomeCanvas with
>   >> an xpm.  How is this done?
> 
>   JH> A stipple is a bitmap, so unless the image is only two colours,
>   JH> I don't think this would work.  I am not sure if there is a way
>   JH> to do what you want with the standard canvas items.
> 
>      Thanks for your response, I appreciate it.  Then is the best way
> to do it to forget about the GnomeCanvas and just use gdk commands?
> For instance, could I make a bitmap of a polygon, and then use that to
> screen off an image, and the result would have the same effect as
> sticking a pixmap in a polygon?  I just don't want to waste time
> trying to do something in a way that can't be done or in an obviously
> stupid way.

That is basically correct.  You want to create a 1-bit depth pixmap
(bitmap) as a mask, and draw the polygon on that.  Then set it as a clip
mask for the GC and then draw the pixmap with it.  This will clip the
pixmap.

> 
>      For instance, I orginally wrote my program (a spherical pager,
> see http://www.stanford.edu/~bescoto/tmp/sphere-pager.jpg for current
> screenshot) using Tkinter, but then switched it to Gtk because I was
> under the impression that GnomeCanvas had (working) anti-aliased
> graphics and polygons I could stick pictures in...
> 
> 
> --
> Ben Escoto

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to