Code example for Picture

Methods: draw, getHeight, getWidth

0
                        OutputStream os = new FileOutputStream(capPic);
                        // pic.writeToStream(os); 
                        // os.flush(); 
                        // os.close(); 
 
                        int width = capture.getWidth();
                        int height = capture.getHeight();
                        Log.d(TAG, "capture pic width = " + width + ",height=" + height);
                        if (width == 0) {
                            Log.d(TAG, "wield,width=0 ");
                            width = 480;
                        } 
                        if (height == 0) {
                            Log.d(TAG, "wield,height=0 ");
                            height = 800;
                        } 
                        Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
                        Canvas canvas = new Canvas(bmp);
                        capture.draw(canvas);
 
                        bmp.compress(Bitmap.CompressFormat.PNG, 90, os);
                        os.close();
 
                        // ImageView m = new ImageView(AndroidDemos.this);