- <?php
- $zoom=4;
- $zoomp=2;
- $a=file_get_contents('Pic2.8xi');
- $img= ImageCreateTrueColor(96*$zoom,63*$zoom);
- $white = ImageColorAllocate ($img, 255, 255, 255);
- $black = ImageColorAllocate ($img, 0, 0, 0);
- $grey = ImageColorAllocate ($img, 210, 210, 210);
- ImageFilledRectangle($img, 0, 0, 96*$zoom, 64*$zoom, $white);
- $c=74;
- $d=$a{$c};
- $e=128;
- for ($y=0;$y<63;$y++){
- for ($x=0;$x<96;$x++){
- if ($d>=$e){
- ImageFilledrectangle($img, $x*$zoom, $y*$zoom, $x*$zoom+$zoomp, $y*$zoom+$zoomp, $black);
- $d=$d-$e;
- }else{
- ImageFilledrectangle($img, $x*$zoom, $y*$zoom, $x*$zoom+$zoomp, $y*$zoom+$zoomp, $grey);
- }
- $e=$e/2;
- if ($e==1/2){
- $e=128;
- $c++;
- $d=ord($a{$c});
- }
- }
- }
-
-
- header('content-type: image/jpeg');
- imagejpeg($img);
- imagedestroy($img);
- ?>
<?php
$zoom=4;
$zoomp=2;
$a=file_get_contents('Pic2.8xi');
$img= ImageCreateTrueColor(96*$zoom,63*$zoom);
$white = ImageColorAllocate ($img, 255, 255, 255);
$black = ImageColorAllocate ($img, 0, 0, 0);
$grey = ImageColorAllocate ($img, 210, 210, 210);
ImageFilledRectangle($img, 0, 0, 96*$zoom, 64*$zoom, $white);
$c=74;
$d=$a{$c};
$e=128;
for ($y=0;$y<63;$y++){
for ($x=0;$x<96;$x++){
if ($d>=$e){
ImageFilledrectangle($img, $x*$zoom, $y*$zoom, $x*$zoom+$zoomp, $y*$zoom+$zoomp, $black);
$d=$d-$e;
}else{
ImageFilledrectangle($img, $x*$zoom, $y*$zoom, $x*$zoom+$zoomp, $y*$zoom+$zoomp, $grey);
}
$e=$e/2;
if ($e==1/2){
$e=128;
$c++;
$d=ord($a{$c});
}
}
}
header('content-type: image/jpeg');
imagejpeg($img);
imagedestroy($img);
?>