안드로이드 개발 질문/답변
(글 수 45,052)
그림을 저장할때 저장되는 그림의 위치가
sdcard밑에 저장되는 게아니라
sdcard밑에 저장되는 게아니라
drawable 폴더밑에 바로저장되서 id사용하여 그림을 다시 불러오고 할수 있나요??
아니면 sdcard폴더 밑에있는 그림파일을 바로 불러와서 배경으로 지정가능한가요?
private void saveView( View view )
{
String path =
Environment.getExternalStorageDirectory().getAbsolutePath();
Bitmap b = Bitmap.createBitmap(
view.getWidth(), view.getHeight(), Bitmap.Config.RGB_565);
if(b!=null){
try {
File f = new File(path+"/notes");
f.mkdir();
File f2 = new File(path + "/notes/"+title+".png");
Canvas c = new Canvas( b );
view.draw( c );
FileOutputStream fos = new FileOutputStream(f2);
if ( fos != null )
{
b.compress(Bitmap.CompressFormat.PNG, 100, fos );
fos.close();
}
//setWallpaper( b );
} catch( Exception e ){
Log.e("testSaveView", "Exception: " + e.toString() );
}
}
}
{
String path =
Environment.getExternalStorageDirectory().getAbsolutePath();
Bitmap b = Bitmap.createBitmap(
view.getWidth(), view.getHeight(), Bitmap.Config.RGB_565);
if(b!=null){
try {
File f = new File(path+"/notes");
f.mkdir();
File f2 = new File(path + "/notes/"+title+".png");
Canvas c = new Canvas( b );
view.draw( c );
FileOutputStream fos = new FileOutputStream(f2);
if ( fos != null )
{
b.compress(Bitmap.CompressFormat.PNG, 100, fos );
fos.close();
}
//setWallpaper( b );
} catch( Exception e ){
Log.e("testSaveView", "Exception: " + e.toString() );
}
}
}
이게 저장되는 부분 소스입니다... 소스에서 진하게되있는부분 경로를 drawable폴더로 바꿀수잇다면 경로가 어케 되나요??
조금만 도와주십시오 ㅠㅠ