Start a new topic

How to save camera frame?

Hi guys,

I have been trying to save the camera frame as follows:

Texture2D tex = Instantiate(cam.CameraTexture);

byte[] bytes = tex.EncodeToJPG();

Debug.Log("TEX INFO: " + tex.width + "x" + tex.height + " PIXEL: " + tex.GetPixel(10,10));

cam was initialised as follows:

cam = GameObject.Find("WikitudeCamera").GetComponent<WikitudeCamera>();

However, everything is white. I can't see what I am doing wrong. I have downloaded the unity plugin couple of weeks ago so it should be pretty up to date.

Any help will be very much appreciated!

Thank you,
Martin Peniak

Also tried using the plugin manager to get the frame, which worked but the frame is in incompatible format and I can't convert it into an you guys know how to solve this or should I leave this?

I have solved this problem myself, thanks!

Login or Signup to post a comment