Camera camera;

SpriteRenderer sprRender;

Texture2D t2d = New Texture2D(1300, 760, TextureFormat.RGB24, false)

RenderTexture rt = New RenderTexture(1300, 760, 24)

camera.targetTexture = rt

camera:Render()

RenderTexture.active = rt

t2d:ReadPixels(New Rect(0, 0, rt.width, rt.height), 0, 0)

t2d:Apply()

RenderTexture.active = null

camera.targetTexture = null

Sprite spr = Sprite.Create(t2d,New Rect(0, 0, rt.width, rt.height), New Vector2(0, 0))

sprRender.sprite = spr

--将图片保存起来

byte[] byts = t2d:EncodeToJPG()

WriteAllBytesToFile(Application.dataPath .. "//" .. "currentMap.jpg", tostring(byts))

获取camera截屏图片的更多相关文章

  1. IOS第17天(2,Quartz2D图片剪裁变圆行图,和截屏图片)

    **** #import "HMViewController.h" #import "UIImage+Tool.h" @interface HMViewCont ...

  2. vue中使用html2canvas及解决html2canvas截屏图片模糊问题

    最近在项目中用到了html2canvas插件,遇到的一些坑写下来,与大家共勉. html2canvas  官方网站http://html2canvas.hertzen.com/index.html 这 ...

  3. Selenium截屏 图片未加载的问题解决--【懒加载】

    需求: 截屏后转PDF. 问题: selenium截屏后,图片未加载 如下图: 原因: 网站使用了懒加载技术:只有在浏览器中纵向滚动条滚动到指定的位置时,页面的元素才会被动态加载. 什么是图片懒加载? ...

  4. 完美解决scrollView 截屏图片模糊

    UIGraphicsBeginImageContext   首先说明一下UIGraphicsBeginImageContextWithOptions 和UIGraphicsBeginImageCont ...

  5. pytest框架优化——将异常截屏图片加入到allure报告中

    痛点分析: 在做allure定制化的时候,关于附件添加这一块,我们在代码里可以添加我们准备好的附件,这里用图片,通过下面的方法就能实现 allure.attach(file, '图片描述', allu ...

  6. [Egret]长按截屏分享、分享截屏图片、本地存储

    egret 分享有API可以把一个显示对象树渲染成一个位图纹理,我把它赋值给 HTML 的 Image 元素,就实现了图片的显示,在微信中,通过长按图片可以分享出去.当然在其他浏览器可以保存在本地. ...

  7. cocos2dx之保存截屏图片

    http://blog.csdn.net/ganpengjin1/article/details/19088921 我们要保存当前的运行的scene的截图的话,我用到CCRenderTexture,看 ...

  8. ios xcode真机调试获取屏幕截屏

    非常多时候我们须要在调试的过程中把手机屏幕截图发给其它人看,在android开发中我们能够非常方便的截图保存.而xcode开发ios的时候发现这个需求却如此困难.网上大部分都是介绍的以下这个方案.可是 ...

  9. iOS检测用户截屏并获取所截图片

    iOS检测用户截屏并获取所截图片 微信可以检测到用户截屏行为(Home + Power),并在稍后点击附加功能按钮时询问用户是否要发送刚才截屏的图片,这个用户体验非常好.在iOS7之前, 如果用户截屏 ...

随机推荐

  1. golang中的rpc包用法

    RPC,即 Remote Procedure Call(远程过程调用),说得通俗一点就是:调用远程计算机上的服务,就像调用本地服务一样. 我所在公司的项目是采用基于Restful的微服务架构,随着微服 ...

  2. request.RequestContextListener

    由于是使用spring mvc来做项目,因此脱离了HttpServletRequest作为参数,不能够直接使用request,要想使用request可以使用下面的方法: 在web点xml中配置一个监听 ...

  3. 【SysML】模块定义图(BDD, Block Definition Diagram)

    一.引言 SysML中的模块定义图,英文为 “Block Definition Diagram”,简称BDD,是系统建模过程中最为常见的图之一,BDD是一种结构图,它主要对系统的结构组成以及组成元素间 ...

  4. c语言二叉树的递归建立

    #include <stdio.h> #include <string.h> #include <stdlib.h> #include <malloc.h&g ...

  5. Springs Element 'beans' cannot have character [children], because the type's content type is element-only

    Springs Element 'beans' cannot have character [children], because the type's content type is element ...

  6. 转换器2:ThinkPhp模板转Django模板

    前天写了个<ThinkPhp模板转Flask模板> 居然被同事鄙视了,原因是他用Django,我用Flask,为了避免被他继续安利Django的强大.我决定写一个Django模板转换器. ...

  7. 分享自己使用CSS的public

    body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select,td,figure{marg ...

  8. Linux运行级别简介

    init 0 : 关机 init 1 : 单用户模式  root init 2 : 多用户模式 不能使用 net file system init 3 : 完全多用户模式 init 4 : 多用户的安 ...

  9. 常见端口、端口查询及TCP状态

    查看电脑端口的开放情况命令:cmd——netstat -a -n -a:显示所有连接和监听端口:-n:以数字形式显示地址和端口号 “本地地址”指本地IP地址及其正在使用的端口号,“外部地址”指连接某端 ...

  10. VMware Ubuntu16.04虚拟机安装MATLAB R2016b

    因为这学期上的模式识别课程需要在Linux环境下使用Matlab,所以就在Windows10主机上的Vmware Workstation上的Ubuntu虚拟机上安装了最新版本的MATLAB. 环境: ...