If you read perldoc SDL::GFX::Rotozoom you will see that SDL::GFX::Rotozoom::surface requires a surface as input, NOT a SDLx::Sprite as you do in your code.# 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, SMOOTHING_ON );
From the perldoc:
Furthermore, from looking thru the SDL perldocs, it seems you can only load BMP files at this time. Have a look at the example script at /examples/GFX/script_roto.pl in the SDL module distribution.my $picture = SDL::Video::load_BMP('test.bmp'); my $rotated = SDL::GFX::Rotozoom::surface( $picture, 45, .8, SMOOTHING_ON +);
Upon further investigation, it looks like you can load a jpg into an SDL::Surface with SDL::Image
use SDL::Image; SDL::Image::init(IMG_INIT_JPG); #loads JPG support SDL::Image::load("file.png"); #loads PNG support SDL::Image::quit(); #unloads everything
In reply to Re: SDL Image Slideshow
by zentara
in thread SDL Image Slideshow
by Xenther
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |