[pygtk] Drawing point,rectangle etc over png using Cairo
nipunreddevil at gmail.com
Tue Dec 1 23:07:18 WST 2009
On Tue, Dec 1, 2009 at 4:51 PM, A.T.Hofkamp <a.t.hofkamp at tue.nl> wrote:
> nipun batra wrote:
>> This is my expose event function
>> def expose(self, widget, event):
>> cr = widget.window.cairo_create()
>> cr.set_source_surface(self.surface, self.border, self.border)
>> cr.set_source_rgb(0.5, 0, 0)
>> Here i am initially drawing the background image and over it i am drawing
>> points.These come from two variables(global) which are updated every clock
>> cycle.Now maintaining a list and plotting it would be tedious and not at all
>> processor friendly.Could you elaborate a bit on the other technique.Using
>> "dirty" regions.
>> Thanks in advance
> I think compared to drawing an image, drawing a few points seems not
> I never used regions, but the idea is to mark an area as 'dirty' (eg the
> area containing the new point). Then you will automatically get an expose
> event, with the area that must be redrawn (probably somewhere in the 'event'
> You can skip drawing all points that are outside that area.
Ok..My code will be redrawing the background image apparently which is
unneccesary.Still not clear with the dirty area concept.Can someone provide
an example.Also how to integrate this widget as a part of a larger
application using sizers
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pygtk