2010-12-13 7 views
0

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html안드로이드 fingerpaint 캔버스 색상

나는 비트 맵을 저장하고 나중에 편집을 다시 열 수있는 위치에 몇 가지 조정을했습니다. 그 모든 일을 해냈습니다. 유일한 문제는 저장된 사본의 캔버스 색상이 내가 설정 한 색상이 아닌 검은 색이어서 편집 할 때 캔바스 색상도 검은 색임을 의미합니다. 저장된 비트 맵을 다음과 같이로드합니다. 파일의 나머지 부분은 SDK에있는 것과 거의 동일합니다. 저는 캔버스를 처음 만들 때와 같이 원하는 색상으로 캔버스를 다시 가져올 수있는 방법을 찾으려고합니다.

public MyView(Context c) { 
     super(c);   
     Bundle extras = getIntent().getExtras(); 
     imageURI = extras.getString(Intent.EXTRA_SUBJECT); 
     mBitmap = BitmapFactory.decodeFile(imageURI); 
     Drawable d = new BitmapDrawable(mBitmap); 
      Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); 
      Canvas canvas = new Canvas(bitmap); 
      d.setBounds(0, 0, width, height); 
      d.draw(canvas); 
      mBitmap = bitmap; 
      mCanvas = canvas; 
      mPath = new Path(); 
      mBitmapPaint = new Paint(Paint.DITHER_FLAG); 
    } 
+0

비트 맵 저장 문제를 해결하려고하기 때문에 코드를 공유 할 수 있습니다. – abhishek

답변

0

신경 쓰지 마라, 그것이 저장되는 방식이었다. 지금 고정

관련 문제