纳金网

标题: Unity截屏代码 [打印本页]

作者: 王者再临    时间: 2014-8-29 03:24
标题: Unity截屏代码
IEnumerator Photo()  
{    int m_width = (int)Screen.width;
      int m_height = (int)Screen.height;
      yield return new WaitForEndOfFrame();
      cutImage = new Texture2D (m_width, m_height,TextureFormat.RGB24, false);
     cutImage.ReadPixels(new Rect(0,0,m_width, m_height),0,0, true);
      cutImage.Apply();
     byte[] byt = cutImage.EncodeToPNG();
}




作者: hyui    时间: 2014-8-29 04:08
Thanks for sharing this !
作者: Kadina    时间: 2014-8-29 07:00
Thanks for sharing !
作者: cgjch8    时间: 2014-8-29 09:08
Thanks for sharing




欢迎光临 纳金网 (http://c-www.narkii.com/club/) Powered by Discuz! X2.5