Xenther has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use SDL; use SDL::Video; use SDL::Rect; use SDL::Surface; use SDLx::Sprite; use SDL::GFX::Rotozoom; use SDLx::App; my $disp = SDLx::App->new( title => 'Ken Burns', width => 1024, height => 800, depth => 32, flags => SDL_ANYFORMAT, resizeable => 1, exit_on_quit => 1 ); #$disp->fullscreen(); my $x = 0; my $y = 0; # This photo is larger than the 1024x800 app size my $big_image = SDLx::Sprite->new( image => '/path/to/photo.jpg' ); my $lil_image = SDL::GFX::Rotozoom::surface( $big_image, 0, 0.7, SMOOT +HING_ON ); for $x ( 0 .. ($lil_image->w-$disp->w) ) { $lil_image->draw_xy( $disp, -$x,0 ); SDL::Video::update_rect( $disp, 0, 0, $disp->w, $disp->h ); # SDL::delay(2); } for $y ( 0 .. ($lil_image->h-$disp->h) ) { $lil_image->draw_xy( $disp, -($lil_image->w-$disp->w),-$y ); SDL::Video::update_rect( $disp, 0, 0, $disp->w, $disp->h ); # SDL::delay(2); } for $x ( 0 .. ($lil_image->w-$disp->w) ) { $lil_image->draw_xy( $disp, -($lil_image->w-$disp->w)+$x,-($lil_image->h-$disp->h) ); SDL::Video::update_rect( $disp, 0, 0, $disp->w, $disp->h ); # SDL::delay(2); } for $y ( 0 .. ($lil_image->h-$disp->h) ) { $lil_image->draw_xy( $disp, 0,-($lil_image->h-$disp->h)+$y ); SDL::Video::update_rect( $disp, 0, 0, $disp->w, $disp->h ); # SDL::delay(1); } #SDL::delay(200);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SDL Image Slideshow
by zentara (Cardinal) on Jun 12, 2012 at 12:33 UTC | |
|
Re: SDL Image Slideshow
by zentara (Cardinal) on Jun 12, 2012 at 13:11 UTC | |
by peter.l (Initiate) on Jul 09, 2013 at 08:09 UTC |