预览的时候,没有做格式转化,所以显示正常!
在设置壁纸的时候,默认是采用jpeg格式转换的,导致转换后损耗了一些,设置壁纸后,某些对比度比较高的壁纸就显示的模糊!
修改方案:
默认修改为采用png格式转换!
android6.0之前的版本,请做如下修改:
定位到/packages/apps/Launcher3/的WallpaperCropActivity.java文件
1、String mOutputFormat = "jpg";//修改为"png"
2、
protected static String getFileExtension(String requestFormat) {
String outputFormat = (requestFormat == null)
? "jpg"//修改为"png"
: requestFormat;
outputFormat = outputFormat.toLowerCase();
return (outputFormat.equals("png") || outputFormat.equals("gif"))
? "png" // We don't support gif compression.
: "jpg";
}
android6.0的版本,请做如下修改:
定位到/packages/apps/Launcher3/WallpaperPicker/src/com/android/gallery3d/common/BitmapCropTask.java文件
if (crop.compress(CompressFormat.JPEG, DEFAULT_COMPRESS_QUALITY, tmpOut)) 修改为:
if (crop.compress(CompressFormat.PNG, DEFAULT_COMPRESS_QUALITY, tmpOut))

 posted on 2017-02-07 10:28  extfff  阅读(477)  评论(0编辑  收藏  举报