繁体   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