Phonegap:相机视图与背景图像 [英] Phonegap : Camera view with background image

查看:110
本文介绍了Phonegap:相机视图与背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Phonegap与Sencha Touch来获取相机功能。但是,我想要一个具有透明背景的图片覆盖在实时相机视图上,而不是默认的相机视图。类似于以下示例,其中恐龙图像已经覆盖在相机视图图像上。

I am using Phonegap with Sencha Touch to get camera functionality. But instead of the default camera view, I want a picture with transparent background to be overlaid upon the live camera view. Similar to below example where a dinosaur image has been overlaid upon the camera view image.

你能告诉我这个功能是否可以通过Phonegap或任何其他方式实现?

Can you tell me whether this feature can be achieved with Phonegap or in any other way?

推荐答案

它可以实现,但它需要一点本地代码和一个简单的技巧。

It can be achieved but it requires a bit of native code and a simple trick.

您需要将phonegap容器设置为透明,并在phonegap容器后面添加一个表面。

You need to set the phonegap container to transparent, and also add a surface behind your phonegap container.

您使用本机代码初始化相机视图,然后phonegap呈现在它的顶部。

You use native code to initialize the camera view and then phonegap renders atop of it.

有关示例,请访问: http ://git.libresoft.es/ARviewer-phoneGap/

这篇关于Phonegap:相机视图与背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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