簡體   English   中英

如何繪制攝像機視圖的圖像框並將圖像框重疊在捕獲的圖像上

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

我是android的新手,正在研究相機應用程序。 在這個應用程序中,我在資產文件夾中有一個透明圖像(圖像幀),並且我希望將此文件顯示為我的相機視圖,而不是本機相機視圖。 我正在使用在表面上使用imageview的帶有Image Frame的相機視圖屏幕,但是無法將它們合並為sdcard上的輸出圖像文件。 請幫忙

提前致謝...

            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;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM