title: how copy drawable in android?
body: <p>hi i would like copy a drawable in a file with android. My problems are my image file are completely black. I don't know why.</p>
  
  <pre><code>    try{
      Drawable image = getResources().getDrawable(R.drawable.header);
      Bitmap  bitmap = Bitmap.createBitmap( image.getMinimumWidth(), image.getMinimumHeight(), Bitmap.Config.ARGB_8888);  
          File fs = new File(Environment.getExternalStorageDirectory()+"/file/header.png");                                   
          FileOutputStream fos;
          fos = new FileOutputStream(fs);
          Canvas canvas = new Canvas(bitmap);
          image.draw(canvas);
          bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); 
          //refermer
          fos.flush();
          fos.close(); 
          } catch (IOException e) {
               e.printStackTrace();
          }
  </code></pre>