note 61343 added to function.printer-draw-bmp

From: Date: Tue, 31 Jan 2006 23:30:30 +0000
Subject: note 61343 added to function.printer-draw-bmp
Groups: php.notes 
Request: Send a blank email to php-notes+get-102797@lists.php.net to get a copy of this message
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. ---- Server IP: 64.246.30.37 Probable Submitter: 63.204.65.205 ---- Manual Page -- http://www.php.net/manual/en/function.printer-draw-bmp.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61343 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61343&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61343&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102797) next »