- Home /
Question by
yasmin1818 · Oct 04, 2017 at 05:22 PM ·
guitexturewebcamtexture
Screenshot from camera
I take an image from camera with screen shot but when I want to get an image from the camera again, no screen shots content.
Texture2D screenCap; void Start() { screenCap = new Texture2D(200, 200, TextureFormat.RGB24, false); } void OnGUI() { if (shot) {
GUI.DrawTexture(new Rect(230, 700, 230, 200), screenCap, ScaleMode.StretchToFill); } } IEnumerator Capture() { yield return new WaitForEndOfFrame(); screenCap.ReadPixels(new Rect(280, 400, 260, 198), 0, 0); screenCap.Apply(); shot = true; } public void okey() { StartCoroutine("Capture");
}
public void buttonagainnewTexture() {
Destroy(screenCap);
eee.SetActive(true);
koooo = false;
}
public void StartCam_Clicked()
{
WebCamDevice device = WebCamTexture.devices[currentCamIndex];
tex = new WebCamTexture(device.name);
display.texture = tex;
tex.Play();
}
Comment
Your answer