0
キャプチャした画像の保存場所を変更する方法を知りたい。 私のコードでは、キャプチャされた画像はスクリーンショットイメージを意味しますandroid studioキャプチャした画像の保存場所を変更する方法
変数SendingImageはビットマップを取得し、次にsdcardまたはどこかにスクリーンショットを保存します。 店の後、私は
スクリーンショットのプレビューを取得する方法がある場合は
File sdCard = Environment.getExternalStorageDirectory();
String filename = "screenshot1.jpg";
ImageView GetImage = (ImageView) findViewById(R.id.show_heyboard);
GetImage.setDrawingCacheEnabled(true);
Bitmap SendingImage;
GetImage.buildDrawingCache();
SendingImage = GetImage.getDrawingCache();
Toast.makeText(getApplicationContext(), "1_is working", Toast.LENGTH_SHORT).show();
try{
File files = new File(sdCard.getAbsolutePath()+"/sdcard");
files.mkdirs();
File f = new File(files, "screaanshot1");
FileOutputStream outStream = new FileOutputStream(f);
SendingImage.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.close();
} catch(IOException e){
e.printStackTrace();
}
GetImage.setDrawingCacheEnabled(false);
、教えてください=ここに私のコードがある文字列
によりスクリーンショットの場所についてのURIを取得したいです!あなたがいる
File files = new File(sdCard.getAbsolutePath()+"/sdcard");
files.mkdirs();
File f = new File(files, "screaanshot1");
:
おかげで:)