Android 将图像放在照相机拍摄的照片上
我想将png文件放在应用程序使用库拍摄的图像上Android 将图像放在照相机拍摄的照片上,android,android-camera,Android,Android Camera,我想将png文件放在应用程序使用库拍摄的图像上 有什么想法吗?您将从图片特肯上的获取此代码中的位图 pictureResult.toBitmap(1000, 1000, new BitmapCallback() { @Override public void onBitmapReady(Bitmap bitmap) { //here bitmap you will get }
有什么想法吗?您将从图片特肯上的
获取此代码中的位图
pictureResult.toBitmap(1000, 1000, new BitmapCallback() {
@Override
public void onBitmapReady(Bitmap bitmap) {
//here bitmap you will get
}
});
从位图中可以转换png文件
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
bitmapData = bos.toByteArray();
File f = new File(getCacheDir(), "temp.png");
try {
boolean newFile = f.createNewFile();
if (newFile) {
FileOutputStream fos = new FileOutputStream(f);
fos.write(bitmapData);
fos.flush();
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}提供一些代码片段,说明如何使用此库首先要保存它,然后从文件中加载它