我創建圖像編程,然後從設備拉動該圖像到PC,並打開該圖像,然後無法查看圖像和獲取消息不能認爲無法打開這個形象,因爲這幅畫是在另一個程序拉圖像從設備到PC,但在PC圖像視圖
這裏正在編輯的代碼是
View content = findViewById(R.id.myview);
content.setDrawingCacheEnabled(true);
content.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
Bitmap bitmap = content.getDrawingCache();
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
File file = new File(path+"/test.png");
try {
file.createNewFile();
FileOutputStream ostream = new FileOutputStream(file);
bitmap.compress(CompressFormat.PNG, 100, ostream);
ostream.close();
Toast.makeText(getApplicationContext(), "image saved", 5000).show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), "error", 5000).show();
}
我失去了關閉該文件或其他任何保存圖片到SD卡後?
編輯:
我知道在這個職位給出,但任何不關閉日食另一種方式是答案嗎?
使用Firefox打開它 – ingsaurabh
不知道這個問題的原因或問題,但選擇圖像做ctrl + c和ctrl + v打開副本 – MKJParekh
問題是我拉的文件是在編輯模式下,不能用於其他目的,如打開PC – Pratik