Android Question Print bitmap on different devices

quansofts

Member
Hi All,
I used below code to print a bitmap captured from a webview to printer. It works but the size of printed bitmap is different in different devices that have different screen resolution. In high resolution phone the printed image is showed good, but in lower resolution phone the image is too large and go out of the paper. How can we print a bitmap at same size in all devices?

Many thanks for your help

Print bitmap:
Dim bmp As Bitmap

bmp=WebView1.CaptureBitmap
bmp = bmp.Resize(bmp.Width, bmp.Height * Ydpi / Xdpi, True)
 
Top