我的程序捕获图像(作为位图),但我不知道(也找不到)如何在自定义路径中使用自定义名称保存它......这是我的图像捕获代码。我可以做吗?或者有什么办法将它保存为另一种数据类型,而不是位图?一些帮助会很棒。谢谢。
public class ShowMessagesPage extends Activity {
final static int CAMERA_RESULT = 0;
DBAdapter db = new DBAdapter(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_messages_page);
Button userButton = (Button)findViewById(R.id.button1);
userButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
error();
}});
Button buttonPhoto = (Button)findViewById(R.id.buttonPhoto);
buttonPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, CAMERA_RESULT);
}});}
protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK) {
Bundle extras = intent.getExtras();
Bitmap bmp = (Bitmap) extras.get("data");
}
}
and the other codes..........