// imgObject.imageData = Util.bmpToByteArray(thumbBmp, true);
// imgObject.imageUrl=shareFilePath;
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }.start();
// }else{
// //本地路径
// Bitmap bmp = BitmapFactory.decodeFile(shareFilePath);
// Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp,99,99, true);
// bmp.recycle();
// imgObject.imagePath=shareFilePath;
// imgObject.imageData = Util.bmpToByteArray(thumbBmp, true);
// imgObject.imageUrl=shareFilePath;
// }
Bitmap bmp = BitmapFactory.decodeFile(shareFilePath);
Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp,99,99, true);
bmp.recycle();
imgObject.imagePath=shareFilePath;
imgObject.imageData = Util.bmpToByteArray(thumbBmp, true);
imgObject.imageUrl=shareFilePath;
}else{
Bitmap bmp =BitmapFactory.decodeResource(//
UiUtils.getInstance().getContext().getResources(), R.mipmap.ic_launcher_logo);
Bitmap thumbBmp=Bitmap.createScaledBitmap(bmp, 99, 99, true);
bmp.recycle();
imgObject.imagePath=shareFilePath;
imgObject.imageData = Util.bmpToByteArray(thumbBmp, true);
imgObject.imageUrl=shareFilePath;
}
// if(!FileUtils.getInstance().isExistsFile(MyApplication.shareZinCodePath)){
// try {
// FileUtils.getInstance().writeToDir(getAssets().open(“mine_share_code.png”),MyApplication.shareZinCodePath);
// } catch (IOException e){
// e.printStackTrace();
// }
// }
// Bitmap bmp =BitmapFactory.decodeFile(MyApplication.shareZinCodePath);
// Bitmap thumbBmp=
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
Bitmap.createScaledBitmap(bmp, 99, 99, true);
// imgObject.imagePath=MyApplication.shareZinCodePath;
// imgObject.imageData=Util.bmpToByteArray(thumbBmp, true);
// imgObject.imageUrl=MyApplication.shareZinCodePath;
// bmp.recycle();
msg.thumbData=imgObject.imageData;
//待定
msg.title = “测试app”;
msg.descrip