简体   繁体   中英

how to draw image frame for camera view and overlapping the image frame on captured image

I am new in android and working on the camera application. In this app I have one transparent image (Image Frame) in assets folder and I want to show this file as my camera view unlike the native camera view. I am getting the camera view screen with the Image Frame using imageview over surface but unable to merge them as output image file on sdcard. Please help

thanks in advance...

            Drawable drbl=null;
            Bitmap topImage = null ;
            Bitmap b=Bitmap.createBitmap(ref_capturedBitmap.getWidth(), ref_capturedBitmap.getHeight(), ref_capturedBitmap.getConfig());
            Canvas comboImage = new Canvas(b);


            int width = ref_capturedBitmap.getWidth();
            int height = ref_capturedBitmap.getHeight();

            Log.v("CameraCaptureActivity","Width : "+width+" Height : "+height );
            if (frameStatus == 0)
                drbl = getResources().getDrawable(R.drawable.maske1r);
            else if (frameStatus == 1)
                drbl = getResources().getDrawable(R.drawable.maske2r);
            else if (frameStatus == 2)
                drbl = getResources().getDrawable(R.drawable.maske3r);

            drbl.setBounds(0, 0, height, width);
            Bitmap tpImg=((BitmapDrawable)drbl).getBitmap();
            topImage=Bitmap.createScaledBitmap(tpImg, width, height, true);

            comboImage.drawBitmap(ref_capturedBitmap,0f,0f,null);
            comboImage.drawBitmap(topImage, 0f, 0f, null);
                            return b;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM