4

我正在制作一个应用程序,在该应用程序中,我从相机捕获图像并从中制作 pdf。

但是图像质量很差。所以我想设置图像的亮度和对比度。

  1. 从Android中的相机捕获后,有什么方法可以增加图像的亮度和对比度?

  2. 在我裁剪图像时捕获图像然后以pdf格式显示后,图像的下部已被剪切。

对于此应用程序中的 pdf 用法,我使用了 iText.jar (5.0.6)。

4

1 回答 1

1

要在生成的 pdf 中显示完整图像,请尝试将“scaleAbsolute”应用于图像。

File newFile = new File(pdfPath);
newFile.createNewFile();
FileOutputStream pdfFile = new FileOutputStream(newFile);

Document document = new Document();
PdfWriter.getInstance(document, pdfFile);
ocument.open();

Rectangle rectangle = document.getPageSize();
Image image = Image.getInstance(imagePath);

image.scaleAbsolute((rectangle.getWidth() - 75.0f),
                    (rectangle.getHeight() - 75.0f));
于 2011-08-10T09:11:32.367 回答