私のアプリケーションは、カメラから画像を取得して保存し、に表示しますImageView
が、次のステップは、ユーザーが画面に触れたときに表示された画像の上に円を配置し、「変更された画像」を保存することです。
必要に応じて画像エディターのようなものですが、問題は、画像編集をどこから始めればよいかわかりません。私はこれを試しました
@Override
public boolean onTouch(View v, MotionEvent event) {
circleView.setVisibility(View.VISIBLE);
circleView.setX(event.getX()-125);
circleView.setY(event.getY()-125);
try{
Bitmap bitmap = Bitmap.createBitmap(relativeLayout.getWidth(),relativeLayout.getHeight(),Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
v.draw(canvas);
mImageView.setImageBitmap(bitmap);
FileOutputStream output = new FileOutputStream(Environment.getExternalStorageDirectory());
bitmap.compress(Bitmap.CompressFormat.PNG,100,output);
output.close();
}catch(FileNotFoundException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
return true;
}//ENDOF onTouch
画像を保存するにはどうすればよいですか?