我的程序捕獲圖像(位圖),但我不知道(也找不到)如何使用自定義名稱將其保存在自定義路徑中...這裏是我的圖像捕捉代碼。我可以做嗎?或者有什麼辦法將它另存爲另一種數據類型,而不是位圖?一些幫助將會很大。謝謝。保存位圖在自定義路徑和自定義名稱
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..........
[http://marakana.com/forums/android/examples/39.html](go) –