note 61343 deleted from function.printer-draw-bmp by sobak
| From: | sobak@php.net | Date: | Thu, 24 Nov 2016 20:30:37 +0000 |
| Subject: | note 61343 deleted from function.printer-draw-bmp by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207573@lists.php.net to get a copy of this message | ||
Note Submitter: Fuzzmaster
----
Added a bit a fuzz:
function print_img($doc,$img,$res,$pos_x,$pos_y)
{
$img_size = getimagesize($img);
$img_resolution = $res;
$img_width = $img_size[0];
$img_height = $img_size[1];
echo $img_width.'<BR>';
echo $img_height.'<BR>';
$ptr_resolution_x = printer_get_option($doc, PRINTER_RESOLUTION_X);
$ptr_resolution_y = printer_get_option($doc, PRINTER_RESOLUTION_Y);
echo $ptr_resolution_x.'<BR>';
echo $ptr_resolution_y.'<BR>';
$img_scale_x = $ptr_resolution_x / $img_resolution;
$img_scale_y = $ptr_resolution_y / $img_resolution;
echo $img_scale_x.'<BR>';
echo $img_scale_y.'<BR>';
$ptr_width = $img_width * $img_scale_x;
$ptr_height = $img_height * $img_scale_y;
echo $doc.'<BR>';
echo $ptr_width.'<BR>';
echo $ptr_height.'<BR>';
printer_draw_bmp($doc,$img,$pos_x,$pos_y,$ptr_width,$ptr_height);
}
print_img($handle, '../img/someimage.bmp', 72, 10, 10);
Of course, if someone can figure out how to capture the resolution of the image from the file
that's one less value to manually assign.