Re: retain image among multiple draw events

Stefan Salewski <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tue, 2015-06-16 at 13:53 +0530, Lokesh Chakka wrote:
> hello,
> 
> I am using GtkDrawingArea for drawing images using cairo graphics. I
> connected one call back function for draw event.
> This call back will be executed multiple times. I am observing that, what
> ever drawing happened in the previous call, is disappearing when the same
> call back function is called next time.
> 
> I want to know how to retain the previously drawn image. If it is a sample
> program, it will be more helpful to me.
> Can some body please help me in this ?
> 

Your observation seems to be wrong. When you investigate the GTK3
drawing area example from
https://developer.gnome.org/gtk3/3.0/gtk-getting-started.html

you will see, that motion_notify_event_cb in called when mouse is moved,
and that function calls draw_brush() only for current coordinate --
earlier drawing is conserved. You may investigate your code, maybe there
is a background clear operation involved. Or your logic of processing
events is wrong. Try to follow that example.

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.