cameraViewTransform translation -- every single hair has been pulled out
In the live camera preview, I simply want to scale the view. As it is currently, the top left corner of the preview is fixed, and as I scale the view with:
the image successfully grows by "zoomFactor", but the top left corner stays fixed to the origin. I am trying to get the preview to grow by zoom factor, and also shift up and to the left. Performing a CGAffineTransformTranslate builds fine, but has no effect at all. I know this can be done, as I've seen it implemented in many different apps. I have scoured my books and the internet as well to no avail. Any help will be greatly appreciated.
Well I figured it out after about 4 more hours. I thought I would post what I did to help anyone who may be in a similar situation. It is actually only a few lines of code and works perfectly.
First, since I want a full screen overlay without distortion of the image, the incoming view must be scaled (I don't know how to put the code boxes into my entry on the forum):
//set the cameraViewTransform so that the preview fills the entire screen in
// y-direction. also stretch x-direction to prevent distortion of image //dimensions.
//create cg affine transform to scale up the preview;
CGAffineTransform stepUp = CGAffineTransformMakeScale(zoom, zoom);
[cameraPicker.view setTransform:stepUp];
And that is it. No more problems.
If anyone has any comments or knows of a better way to do this I would like to hear. Hopefully in the least I can save someone from the grief I have endured for the last two days.
all the item (buttons and toolbars)are disappering only camera view is displaying
Quote:
Originally Posted by crazyA
Well I figured it out after about 4 more hours. I thought I would post what I did to help anyone who may be in a similar situation. It is actually only a few lines of code and works perfectly.
First, since I want a full screen overlay without distortion of the image, the incoming view must be scaled (I don't know how to put the code boxes into my entry on the forum):
//set the cameraViewTransform so that the preview fills the entire screen in
// y-direction. also stretch x-direction to prevent distortion of image //dimensions.
//create cg affine transform to scale up the preview;
CGAffineTransform stepUp = CGAffineTransformMakeScale(zoom, zoom);
[cameraPicker.view setTransform:stepUp];
And that is it. No more problems.
If anyone has any comments or knows of a better way to do this I would like to hear. Hopefully in the least I can save someone from the grief I have endured for the last two days.
-Alex
Hey Alex nice code but when iam using that in my app.. after touching zoom in button its is zooming but all the buttons and tollbars are hiding can you help me about this..please send code mailid: parthasaradhi.y@gmail.com