<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 11/25/2010 07:09 AM, Dov Grobgeld wrote:
<blockquote
cite="mid:AANLkTi=bosjSG30rq+k+m+J4hUy_+pnnh79H+U+r8x5g@mail.gmail.com"
type="cite">
<div dir="ltr">My guess is that the source of the problem is
explained in the following quote from the cairo-xlib-surface
documentation:<br>
<p><span class="term"></span></p>
<div style="margin-left: 40px;">Currently, only TrueColor visuals are
fully supported.
<br>
</div>
<br>
which means that you don't have alpha support when drawing. One way of
solving this is to create a second image surface on which you do your
drawing that you then draw to the xlib-surface without any scaling.
This basically means keeping an entire copy of the window as a
backstore image that you then copy to the xlib-surface when needed. <br>
<br>
Perhaps someone else can give a better solution.<br>
<br>
Regards,<br>
Dov<br>
</div>
</blockquote>
I don't know about a better solution but one that works for me is to
use gd (gd-2.0.36 is available under Ubuntu) to load and scale the
image. I have attached an example program that displays a very large
jpeg image (21600X10200 pixels, yes really 200M+ pixels) from the NASA
Big Blue Earth collection (i.e.
<a class="moz-txt-link-freetext" href="http://visibleearth.nasa.gov/view_rec.php?id=7106">http://visibleearth.nasa.gov/view_rec.php?id=7106</a>). Loading the
original image takes a few seconds but then scaling / translating is
faster than you can see.<br>
<br>
Some notes:<br>
<br>
As noted above you need true four channel images so the expose
handler must add an alpha channel.<br>
<br>
This example uses jpeg support but gd also has png support<br>
<br>
This example program is just the init and expose handler. If
anyone is interested I can post the driver as well.<br>
</body>
</html>