我为Android连接了GPUImage库,一切都很好用,但是当我尝试加载图像时,庄稼和尺寸非常小,我怎样才能加载并保存全尺寸的图片?
答案 0 :(得分:0)
这是我使用GPUImage保存照片全分辨率的代码:
private void startSavePhoto(String originalPhotoFilePath) {
final String TEMP_FOLDER = AppConst.PATH_FILE_SAVE_PHOTO + AppConst.PATH_FILE_SAVE_TEMP;
ExtraUtils.createFolder(TEMP_FOLDER);
final String TEMP_FILE_NAME = ".ImageEffect.png";
// Save Photo based on original file
Bitmap source = BitmapFactory.decodeFile(originalPhotoFilePath);
String pathFile = TEMP_FOLDER + File.separator + TEMP_FILE_NAME;
Bitmap bitmap = gpuImage.getGPUImage().getBitmapWithFilterApplied(source);
// Bitmap to File
if (ExtraUtils.saveBitmapToPNG(bitmap, pathFile)) {
showSaveWithAdsDialog(pathFile);
} else {
T.show(R.string.error_save_image);
}
}