All pastes #348246 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-10 01:01 UTC
rendered paste body
<?php

$firstwhite[30];

$nextwhite[30];

$results[30];

$ascii[30];

echo "Refresh page to redo<br><br>";

$pic= ImageCreateFromPng("PNG.png");

//get first white pixel
for($y=0;$y<30;$y++)
{

    for($x=0;$x<100;$x++)
    {
    
        $pixel1=imagecolorat($pic, $x, $y);

        if ($pixel1==1)
        {

            $firstwhite[$y]=$x;
            break;

        }

    }
}
//end get first white pixel

//get second white pixel
for($y=0;$y<30;$y++)
{

    for($x=0;$x<100;$x++)
    {
    
        $pixel1=imagecolorat($pic, $x, $y);

        if ($pixel1==1)
        {

            $nextwhite[$y]=$x;

        }

    }
}
//end get second white pixel

for($a=0;$a<30;$a++)
{

    $results[$a]=$nextwhite[$a]-$firstwhite[$a];
    echo "$nextwhite[$a]-$firstwhite[$a]=$results[$a]<br>";

}

echo "<br><br>";

for($b=0;$b<30;$b++)
{
    $ascii[$b]=chr($results[$b]);
    echo "$ascii[$b]";
}


?>