Android PdfDocument.Page - Problems with image size

前端 未结 4 1335
闹比i
闹比i 2021-02-14 17:50

I am experiencing problems with images being larger when drawing onto a PdfDocument.Page. The app is targeted for a device running Android 4.4.4 (API level 19).

I am gen

4条回答
  •  孤独总比滥情好
    2021-02-14 18:23

    [I copied your solution to an answer. If you have found a solution please create an answer and accept it yourself]

    I have tried setting the bitmap density to a value higher than what I think it should be: logo.setDensity(DisplayMetrics.DENSITY_XHIGH); And this did the trick. (I originally set it to DENSITY_HIGH, but it was still scaling the image up slightly, so changed it to DENSITY_XHIGH.)

提交回复
热议问题