我是新來的iPhone應用程序中使用UIImagePickerController。我在UIView中添加了兩個UIButton,並將該視圖設置爲UIImagePickerController的覆蓋視圖。當用戶點擊ZoomIn按鈕時,相機圖像應該放大,當用戶點擊ZoomOut按鈕時,相機圖像應該放大。我已經嘗試了下面的代碼,但它不起作用。如何在iPhone相機中使用UIButtons和UIImagePickerCameraControl自定義ZoomIn和ZoomOut功能?
imgpicker.wantsFullScreenLayout = YES;
imgpicker.cameraViewTransform = CGAffineTransformScale(imgpicker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
imgpicker.view.userInteractionEnabled=YES;
CAMERA_TRANSFORM_X 1 CAMERA_TRANSFORM_Y 1.24299
imgpicker.cameraViewTransform = CGAffineTransformScale(imgpicker.cameraViewTransform,CAMERA_TRANSFORM_X,CAMERA_TRANSFORM_Y); 我已經在兩個按鈕點擊事件中使用了這條線。在zoomin我都用過,
imgpicker.cameraViewTransform = CGAffineTransformScale(imgpicker.cameraViewTransform, CAMERA_TRANSFORM_X+1.0, CAMERA_TRANSFORM_Y+1.0);
和縮小(ZoomOut)我都用過,
imgpicker.cameraViewTransform = CGAffineTransformScale(imgpicker.cameraViewTransform, CAMERA_TRANSFORM_X-1.0, CAMERA_TRANSFORM_Y-1.0);
可否請您建議的代碼和思路來解決這個問題?請幫幫我。提前致謝。