Picture专成Bitmap并保存到sd卡

 Bitmap  b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);


                Canvas c = new Canvas( b );


                picture.draw( c );


                FileOutputStream fos = null;


                try {


                        fos = new FileOutputStream( "/sdcard/yahoo_" +
System.currentTimeMillis() + ".jpg" );


                        if ( fos != null )
                        {
                                b.compress(Bitmap.CompressFormat.JPEG, 90, fos );


                                fos.close();
                        }


                } catch( Exception e )
                        {
                        //...
                        }
                }
          });

 

你可能感兴趣的:(C++,c,Yahoo,C#)