Just in case you are still scratching your head, here is a script that will load a jpg and scale it down. I cobbled it together from the perldocs.
#!/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; use SDL::Image; SDL::Image::init(IMG_INIT_JPG); #loads JPG support my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE +); my $pixel = SDL::Video::map_RGB( $display->format, 0, 0, 0 ); SDL::Video::fill_rect( $display, SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel ); Carp::confess SDL::get_error if !$display; 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 $big_image = SDL::Image::load('1Zen16.jpg'); #loads jpg print "$big_image\n"; my $lil_image = SDL::GFX::Rotozoom::surface( $big_image, 0, 0.7, SMOOT +HING_ON ); print "$lil_image\n"; draw($lil_image); #my $temp_surf = SDL::GFX::Rotozoom::shrink_surface( $big_image, .7, . +7); # shrink dos'nt work for me... gives floatingpoint errors #Carp::confess SDL::get_error if !$temp_surf; #draw( $temp_surf ); sub draw { SDL::Video::fill_rect( $display, SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel ); my $surface = $_[0]; SDL::Video::blit_surface( $surface, SDL::Rect->new( 0, 0, $surface->w, $surface->h ), $display, SDL::Rect->new( 0, 0, $display->w, $display->w ) ); SDL::Video::update_rect( $display, 0, 0, 640, 480 ); } $disp->run();

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: SDL Image Slideshow by zentara
in thread SDL Image Slideshow by Xenther

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.