GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 9:25 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: image transitions (still Noobie)
PostPosted: Tue May 13, 2008 4:07 pm 
Offline
Familiar Face

Joined: Mon May 12, 2008 1:50 pm
Posts: 10
Hi Everyone,

I'm currently developing a slide show program using GTK. I'm trying to create some transitional effects between images.

After some digging I found the gdk_window_clear_area() function, which clears an area of window to the background pixmap.

If I use two planes (current & background), I could load a new image to the background, then remove the current image using the gdk_window_clear_area() function. The wipe down effect would be something like -

Quote:
for (y = 0 ; i < ymax ; y++)
{
gdk_window_clear_area ( window, 0, y, xmax, 1 ) ;
<some delay>
}


I'm struggling at the first hurdle loading the "current & background" images. Is there a simple snippet somebody could point me to?

Regards,

Lee


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 4:40 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Not really my area of expertise... but upon first thought I would think for a sort of "wipe" effect you could use gdk_pixbuf_copy_area () to copy the new image onto the old image one rectangle at a time, say 10 pixels high and all the way across. The function that does this could run every 100 milliseconds or so using g_timeout_add().

Just an idea.

If you intend to get really fancy, you could use another library, like GraphicsMagick (a fork of ImageMagick) http://www.graphicsmagick.org/

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group