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 modePrintHelper.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 ...

Get Android™ How to Program, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.