Martin and Tomeu,<br><br>Martin, thanx a lot for such a detailed answer. I have got what you want to say. But the problem with me right now is that I think the get_preview function is available only in the latest release of sugar 0.84 because I am on 0.82, and my xo gives an error -- " Activity module does not have an attribute get_preview" . Is it so that the function has been added after 0.82 ? If yes, then is there any way on 0.82 build to take screenshots programatically. <br>
<br>There is one strange thing which I am encountering right now. Though the log gives an error that get_preview function is not present but when I ran write 63.xo on the machine ( after replacing sugar.graphics.colorbutton with gtk.colorButton in toolbar.py ) , closed it and then again tried to restart the activity from the journal , I was able to see the following preview which I am attaching with this mail, that was what was there on my activity screen before I closed it.<br>
<br>Though I am not very much sure, but this should have happened because of the save function in activity.Activity class , here is the link- <a href="http://api.sugarlabs.org/sugar.activity.activity-pysrc.html">http://api.sugarlabs.org/sugar.activity.activity-pysrc.html</a> , which calls the get_preview function of sugar, which is a bit contradictory, if we consider the result of the logs. Am I wrong in the way I am understanding this? Kindly give your comments. <br>
<br>Regards,<br>sumit.<br><br><br><br><br><br><br><div class="gmail_quote">On Mon, Jul 20, 2009 at 6:58 PM, Martin Sevior <span dir="ltr"><<a href="mailto:msevior@gmail.com">msevior@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Sumit,<br>
<br>
I just fixed the example code in the pyabiword module of abiword to<br>
give an example<br>
of how this works.<br>
<br>
The important line in this example is:<br>
<br>
i.props.pixbuf = abi.render_page_to_image(1)<br>
<br>
The converts page number 1 to a GdkPixbuf. Once you have a GdkPixbuf,<br>
in this case in<br>
a Gtk.Image you can convert it to whatever format you wish.<br>
<br>