相机聚焦,相机截屏
来源:互联网 发布:fl软件下载 编辑:程序博客网 时间:2024/04/30 15:36
相机聚焦:
using UnityEngine;using System.Collections;namespace Vuforia{ public class focus : MonoBehaviour { // Use this for initialization void Start() { } void Update() { CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO); } }}
相机截屏:
using System.Collections;using System.Collections.Generic;using UnityEngine;using System.IO;public class ScreenShot:MonoBehaviour{public void screenShot1(){ //获取系统时间并命名相片名 System.DateTime now = System.DateTime.Now; string times = now.ToString (); times = times.Trim (); times = times.Replace ("/","-"); string filename = "Screenshot"+times+".png"; //判断是否为Android平台 if (Application.platform == RuntimePlatform.Android) { //截取屏幕 Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0); texture.Apply(); //转为字节数组 byte[] bytes = texture.EncodeToPNG(); string destination = "/storage/emulated/0/DCIM/Camera"; //判断目录是否存在,不存在则会创建目录 if (!Directory.Exists (destination)) { Directory.CreateDirectory (destination); } string Path_save = destination+"/" + filename; //存图片 System.IO.File.WriteAllBytes(Path_save, bytes); } } }
阅读全文
0 0
- 相机聚焦,相机截屏
- 自定义Camera,闪光灯,相机切换,相机聚焦
- Android自定义相机定点聚焦
- unity 相机截屏
- 相机
- 相机
- 相机
- 相机
- 相机
- 相机
- 相机
- 相机
- 相机
- Unity3D Vuforia Android 相机聚焦模式设置
- lytro 光场相机 重聚焦
- 自定义相机 触摸聚焦,添加可控层
- vuforia unity实现相机自动聚焦
- Unity根据相机截屏
- 21. Python脚本学习笔记二十一图形化界面
- 一些测试错题
- ajax,json学习笔记(五)总结
- UVA
- 22. Python脚本学习笔记二十二数据库支持
- 相机聚焦,相机截屏
- 机器学习十大算法原理总结
- 23. Python脚本学习笔记二十三网络编程
- 6.10 水仙花数
- 24. Python脚本学习笔记二十四屏幕抓取
- 华为热备份路由协议 vrrp 双主双备
- 安装imageio
- Cypress-USB-PnP事件注册方法
- 清空cmake的输出