如何添加水印到Android的相机preVIEW [英] How to add watermark to the camera preview in android

查看:325
本文介绍了如何添加水印到Android的相机preVIEW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用我的相机application.It preVIEW应该有一个水印,而同时拍摄照片,甚至显示了preVIEW后also.It也应该保存图像与水印。

I am using camera preview in my application.It should have a watermark while taking a photo and even after showing the preview also.It should also save the image with that watermark.

我刚添加的ImageView,来显示图像的同时拍照。

I just added Imageview, to show the image while taking photo.

     <FrameLayout android:id="@+id/preview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/button_layout"
        android:layout_below="@+id/middle1">
  </FrameLayout>

  <ImageView android:id="@+id/img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/button_layout"

        android:background="@drawable/fblogo"  />

我也能保持这个形象,同时拍照,并显示它不保存此水印image.But的preVIEW。

I can able to keep this image while taking photo and showing preview of image.But it is not saving this watermark.

我认为它只是工作即使考虑后的图像显示image.How我可以添加此水印图像。

I think it just working to show the image.How can I add this watermark to image even after taking the image.

这ImageView的我加入了刚刚出现在我的surfaceview,但图像是不是跟这个节省watermark.only从相机拍摄的图像是越来越保存。

This imageview I have added is just showing on my surfaceview,but the image is not saving with this watermark.only the image taken from camera is getting saved.

感谢

推荐答案

您必须做的从照片帆布拍摄,然后在画布上叠加水印图像。

You have to make Canvas from the photo taken, and then overlay watermark image on the canvas.

尝试德克兰Shanaghy的答案

Try to the answer of Declan Shanaghy

<一个href=\"http://stackoverflow.com/questions/1540272/android-how-to-overlay-a-bitmap-draw-over-a-bitmap\">Android:如何叠加,一个位图/抽取了一个位图?

这篇关于如何添加水印到Android的相机preVIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆