Help for this page

Select Code to Download


  1. or download this
    for($y=1;$y <= $height;$y++){
        for($x=1;$x <= $width;$x++){
    
  2. or download this
    for my $y ( 0 ..  $height - 1 ){
        for my $x ( 0 .. $width - 1 ){
    
  3. or download this
    for my $y ( 1 .. 3 ) { 
        for my $x ( 1 .. 3 ) { 
    ...
    [1:3] =>  2
    [2:3] =>  5
    [3:3] =>  8
    
  4. or download this
            my $pixel = ( $y * $width ) + $x;
    
  5. or download this
            if( $data[ $pixel ] == 0 ){
                $image->setPixel( $x, $y, $dbz1 );
    ...
            if ($data[$pixel] > 20 and $data[$pixel] <= 30){
                $image->setPixel($x,$y,$dbz15);
            }
    
  6. or download this
            if( $data[ $pixel ] == 0 ){
                $image->setPixel( $x, $y, $dbz1 );
    ...
            else {
                ## What do you want to do if the value is greater than 30?
    +?
            }
    
  7. or download this
    open JPEG,'>','test_image.jpg' || die;
    print JPEG $image->jpeg();
    
  8. or download this
    binmode JPEG;
    
  9. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    print JPEG $image->jpeg();
    close JPEG;
    exit;