You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php
$FILE = fopen( 'no-signal_h.png', "rb" ); $idx = 0; $CL = array(); $CC = array(); $cnt = 0; while( !feof( $FILE ) ){ if( ( $byte = fread( $FILE, 1 ) ) !== false ){ $OO = bin2hex($byte); if( strlen( $OO ) == 2 ){ $cnt++; $CC[$idx] = '0x'. $OO; $idx++; if( ( $idx % 16 ) == 0 ){ $CL[] = implode( ',', $CC ); $idx = 0; }; }; }; }; fclose( $FILE ); if( $idx ){ $BL = array(); for( $i = 0; $i < $idx; $i++ ){ $BL[$i] = $CC[$i]; }; $CL[] = implode( ',', $BL ); }; echo "const unsigned char no_frame_png_1600x900[{$cnt}] = {\n"; $id = 0; foreach( $CL as $C ){ $id++; if( $id < count( $CL ) ){ echo "\t" . $C . ",\n"; } else { echo "\t" . $C . "\n"; }; }; echo "};\n";?>
|