DoodleView Method printImage
On Android 4.4 and higher devices, method printImage (Fig. 7.33) uses the Android Support Library’s PrintHelper class to print the current drawing. Line 301 first confirms that printing support is available on the device. If so, line 304 creates a PrintHelper object. Next, line 307 specifies the image’s scale mode—PrintHelper.SCALE_MODE_FIT indicates that the image should fit within the printable area of the paper. There’s also the scale mode PrintHelper.SCALE_MODE_FILL, which causes the image to fill the paper, possibly cutting off a portion of the image. Finally, line 308 calls PrintHelper method printBitmap, passing as arguments the print job name (used by the printer to identify the print) and the Bitmap containing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access