[Image-SIG] AGG-based drawing for PIL

www.stani.be s_t_a_n_i at yahoo.com
Tue Oct 25 22:38:47 CEST 2005


Any chance for a cross-platform solution?
Stani
--
SPE - Stani's Python Editor 
http://pythonide.stani.be
http://pythonide.stani.be/manual/html/manual.html

--- Fredrik Lundh <fredrik at pythonware.com> wrote:

> continuing the tradition of announcing new releases
> by replying
> to myself:
> 
> > the "aggdraw" module is a prerelease of a new
> drawing library for PIL,
> > based on Maxim Shemanarev's antigrain (AGG)
> graphics library.  This
> > module implements a WCK-style drawing interface
> (see below), and
> > provides anti-aliasing and alpha compositing.
> 
> A very early 1.2 alpha is now available.
> 
> You can now create "drawable Windows DIB surfaces",
> and blit them
> to screen under any Windows-based toolkit that lets
> you access the
> HWND for a toolkit window.
> 
>     draw = aggdraw.Dib("RGB", (width, height))
>     ... draw as usual ...
>     draw.expose(hwnd) # blit to screen
> 
> Here's a Tkinter example:
> 
>     size = width, height
> 
>     draw = aggdraw.Dib("RGB", size)
>     ... draw as usual ...
> 
>     # display the image
>     frame = Frame(width=size[0], height=size[1],
> bg="")
>     frame.bind("<Expose>", lambda e:
> draw.expose(e.widget.winfo_id()))
>     frame.pack()
> 
> A source kit can be found here:
> 
>     http://effbot.org/downloads/#aggdraw
> 
> To display aggdraw images under Tkinter on other
> platforms, you can use
> PIL's ImageTk.PhotoImage object, or the WCK toolkit.
>  See
> 
>     http://effbot.org/zone/wck-aggview.htm
> 
> for an example on how to use the latter.
> 
> </F>
> 
> 
> 
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


More information about the Image-SIG mailing list