GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

image transitions (still Noobie)

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
ldavies
Familiar Face


Joined: 12 May 2008
Posts: 10

PostPosted: Tue May 13, 2008 4:07 pm    Post subject: image transitions (still Noobie) Reply with quote

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
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 505
Location: Portland, OR USA

PostPosted: Tue May 13, 2008 4:40 pm    Post subject: Reply with quote

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/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP