如何使用相机“圆圈"覆盖捕获图像并将其保存在 Xamarin.forms (Android) 中的路径上 [英] How Capture image using camera 'Circle' overlay and Save it on path in Xamarin.forms (Android)

查看:25
本文介绍了如何使用相机“圆圈"覆盖捕获图像并将其保存在 Xamarin.forms (Android) 中的路径上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 xamarin.forms 的新手,我想使用 xamarin.forms 制作一个应用程序来捕获图像并保存在给定的路径中.我还想添加相机叠加圆形形状裁剪图像.我发现以下示例项目-

I am new in xamarin.forms and i wants to make a app using xamarin.forms for capture a image and save in given path. i also want add Camera Overlay to crop image in Circle shape. I have found below sample project-

'https://github.com/CrossGeeks/OverlaySample'

并修改它以在公共项目中添加按钮并使用渲染调用捕获事件.捕获事件成功触发,但由于上述示例中的SurfaceView",图像捕获无法正常工作.

and modified it to add button in common project and call capture event using rendering. capture event successfully fire but image capturing not working because of 'SurfaceView' in above sample.

请帮助 - 如何使用 'SurfaceView' 捕获图像.

Please help- How to capture image using 'SurfaceView'.

提前致谢.

推荐答案

SurfaceView 在原生Android中使用,你可以在android项目中创建一个包含surfaceview的customview,然后创建一个自定义viewrenderer 和 SetNativeControl(your customview) 你可以参考 Android 项目中的 CameraPreviewRendererNativeCameraPreview 类和 CameraPreview 类在表单项目中.您可以参考 SurfaceView 了解更多信息和 示例使用surfaceview

SurfaceView is in used in the native Android, you could create a customview that include an surfaceview in android project,then create a custom viewrenderer and SetNativeControl(your customview) your could refer to the CameraPreviewRenderer ,NativeCameraPreview classes in android project and CameraPreview class in forms project.You can refer to SurfaceView for more information and a sample for using surfaceview

这篇关于如何使用相机“圆圈"覆盖捕获图像并将其保存在 Xamarin.forms (Android) 中的路径上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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