- Home /
WebCamTexture on iOS showing different area
I'm using Unity's WebCamTexture to capture images of the back camera from my IPad. While on the PC, using the integrated monitor camera, this just works fine, I experience a strange kind of zoom on the IPad. You can see on image img_0340.jpg what the iOS camera app captures and on img_0341.jpg the textured plane. (Yes the aspect ratio is different and i cut out some gui parts) It just looks like if I zoomed in with the iOS camera app. How can I see the full scene? Whats going wrong here?
Thanks, Thomas
Seems it only happens if the aspect ratio of the camera resolution is different from 4:3 e.g. 16:9.
Answer by Alex-Chouls · Jan 04, 2015 at 10:25 PM
I just ran into this myself. The web cam texture aspect ratio does not match the screen aspect ratio.
This was my fix:
var webCamTexture = new WebCamTexture(deviceName, (int)(Camera.main.aspect * 720f), 720, 30);
I can't seem to find any official documentation on the maximum WebCamTexture size. Most posts say 1280x720.
If you request a bigger texture Unity seems to round down to 1280x720 WITHOUT keeping the aspect ratio that you requested. So really you have to actually calculate the dimensions yourself.
It would be nice if you could just request a Screen.width x Screen.height texture and get the largest possible texture with the correct aspect ratio!
Is it possible to use UI buttons to Zoom the web cam in and out in some way?
Your answer
![](https://koobas.hobune.stream/wayback/20220613121010im_/https://answers.unity.com/themes/thub/images/avi.jpg)