<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hurray, I've got pie menus reading icons from png files
(cairo.ImageSurface.create_from_png) and centering the icons above the
item labels! <br>
<br>
I'd love to know the trick to reading SVG files, please -- that would
really work well with pie menus, especially once I get some cool
scaling and rotating feedback implemented. <br>
Is there a way to load an SVG file into a surface cache with a
transparent background? <br>
How do you measure an SVG file's size, or do you have to know what size
to render it? <br>
<br>
Can you please recommend a good source of documentation about pycairo
and pango from a python programmer's point of view? <br>
I've found the gtk doc that has some of this stuff, but it seems to be
missing a lot of the lower level cairo stuff, just pangocairo
documentation without links into the cairo module documentation. <br>
<br>
For example, this tells about paingocairocontext but has no
documentation link for cairo.Context...<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.pygtk.org/docs/pygtk/class-pangocairocairocontext.html">http://www.pygtk.org/docs/pygtk/class-pangocairocairocontext.html</a><br>
<br>
Thanks a lot for the help! <br>
<br>
-Don<br>
<br>
<br>
Marco Pesenti Gritti wrote:
<blockquote cite="mid1172569448.2971.5.camel@localhost.localdomain"
type="cite">
<pre wrap="">On Mon, 2007-02-26 at 18:35 -0800, Don Hopkins wrote:
</pre>
<blockquote type="cite">
<pre wrap="">So here is a naive resource management question:
What is the best way to configure and pass icons and graphical resources
into cairo based widgets, measure and draw them on the screen efficiently?
(It would be nice if the same icon is used in a lot of places, it only
got loaded once, and stuff like that...)
</pre>
</blockquote>
<pre wrap=""><!---->
What we are currently doing for our icons is to render them (they are
svg) on a buffer context, created like this:
target = ctx.get_target()
buf = target.create_similar(cairo.CONTENT_COLOR_ALPHA, w, h)
And then copy them on the widget context with:
ctx.set_source_surface(buf, x, y)
ctx.paint()
Marco
</pre>
</blockquote>
<br>
</body>
</html>