Tag: 照片

ANDROID ZXING:在onPreviewFrame中保存照片每帧都会保存一张照片。 如何在扫描时保存单张照片?

在过去的几个星期里,我一直试图改变Zxing在扫描后立即拍照。 感谢帮助,我可以在PreviewCallback.java中一直保存onPreviewFrame类中的图像。 我在onPreviewMethod方法中使用的代码将遵循,然后简要介绍我的应用程序的工作方式。 public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); Handler thePreviewHandler = previewHandler; android.hardware.Camera.Parameters parameters = camera.getParameters(); android.hardware.Camera.Size size = parameters.getPreviewSize(); int height = size.height; int width = size.width; System.out.println(“HEIGHT IS” + height); System.out.println(“WIDTH IS” + width); if (cameraResolution != null && thePreviewHandler != null) { YuvImage im = new […]

从保管箱解密图像并显示

我想解密照片,它将在我的三星Galaxy选项卡上显示它,我尝试了ByteArrayOutputStream,当我在我的模拟器中运行它时,当我从dropbox中随机下载照片时,它会显示内部错误。 这是为什么这样的? 或者我从保管箱调用了错误的路径? 有人帮我解决这个问题吗? 因为我已经尝试了很多方法来解决它但我仍然无法解决问题.. // Now pick a random one int index = (int)(Math.random() * thumbs.size()); Entry ent = thumbs.get(index); String path = ent.path; mFileLen = ent.bytes; String cachePath = mContext.getCacheDir().getAbsolutePath() + “/” + IMAGE_FILE_NAME; try { KeyGenerator keygen = KeyGenerator.getInstance(“DES”); SecretKey key = keygen.generateKey(); //generate key byte[] encryptedData; byte[] decryptedData; Cipher cipher = […]

使用Android拍摄单色照片(黑白)

我想在我的应用程序中拍摄真黑白照片。 我搜索了解决方案(也在这个网站上),但我总是找到解决方案将照片放在灰度(例如在本主题中 ),但它不是我要找的… 我还找到了一个提出这个主题的话题: public static Bitmap createContrast(Bitmap src, double value) { // image size int width = src.getWidth(); int height = src.getHeight(); // create output bitmap Bitmap bmOut = Bitmap.createBitmap(width, height, src.getConfig()); // color information int A, R, G, B; int pixel; // get contrast value double contrast = Math.pow((100 + value) / 100, […]

图像resize质量(Java)

我有一个开源应用程序,可以将照片上传到Facebook。 为了节省带宽,照片会在上传前自动resize(Facebook规定了最大尺寸限制)。 有些人抱怨照片质量,事实上你可以看到差异(对于一些演示图像,请参阅此问题 )。 所以我的问题是,在不降低质量的情况下缩小Java中的图像(即照片)的“最佳”方法是什么,或者至少在质量损失/伪影最小的情况下? 您可以在此处查看我当前的代码(通过此页面调整代码大小)。