= 0) { $X=0; while ($X < 240) { $COLOR = unpack("v",substr($IMG,$P,2)); $blue = ($COLOR[1] & 0x001f) << 3; $green = ($COLOR[1] & 0x07e0) >> 3; $red = ($COLOR[1] & 0xf800) >> 8; $COLOR[1] = $red * 65536 + $green * 256 + $blue; imagesetpixel($res,$X,$Y,$COLOR[1]); $X++; $P += $BMP['bytes_per_pixel']; } $Y--; $P+=$BMP['decal']; } fclose($f1); return $res; } $im=ImageCreateFromBMP("bild.raw"); $rReturnImage = imagecreatetruecolor ( 240, 220 ); for ( $iX = 0; $iX < 240; $iX++ ) { $iYr = 0; for ( $iY = ( 220 - 1 ); $iY >= 0; $iY-- ) { $iColorIndex = imagecolorat ( $im, $iX, $iY ); imagesetpixel ( $rReturnImage, $iX, $iYr, $iColorIndex ); $iYr++; } } header('Content-type: image/jpeg'); imagejpeg($rReturnImage, NULL, 75); imagedestroy($im); imagedestroy ( $rReturnImage ); ?>