My app stopped working correctly with iOS 4.3. It uses a custom camera view overlay for the UIImagePickerController. And I want to adjust the size and origon of the camera preview view by set cameraViewTransform as CGAffineTransformMakeTranslation and CGAffineTransformScale, but the CGAffineTransformMakeTranslation seems to have no effect, However scale and rotate transforms work as expected. And the preview View is always in the center of the screen, I want to make the change.
I had try method as below, but does not work too.
Scaled live iPhone Camera view in center, "CGAffineTransformTranslate" not working
Any suggestion? Thanks.
Yes, I am seeing this on my 4.3 iPhone, but not on the ones with 4.2 and older. So it is definitely a bug.
I ended up just moving the picker frame to get this to work. check out my answer here: https://stackoverflow.com/a/9458688/791661
Related
I'm trying to convert an iPhone application to work universally (on both iPhones and iPads). I've managed to get the frame to re-size correctly, but it seems like the bounds (the part the user can actually interact with) isn't re-sizing appropriately with it. So, for instance, a UIWebView will be drawn in the correct dimensions, but I can only interact with it within a smaller confine the size of an iPhone screen.
Any thoughts what's going on?
How are you re-sizing this view? Is it in an xib with autoresizing mask set to properly expand? If so something else is going wrong. I just tried making a sample project with a webview, where the xib is sized for iPhone. I then marked the application as universal, and it runs just fine in the iPad simulator with all areas touchable.
So, I was creating an application for iOS with Xcode 4.2.1, I don't know why all of my icons are blurry, they are in high definition, but for some reason they looks blurry and in a bad quality.
even the background images looks bad..
Please help me, what can I do about it?
This is the original button image:
This is how it looks on the application:
Make sure you saved the high-resolution images with the ending #2x.png, if they aren't they won't work. Also remember that the images needs to be twice the size of the pixles on the screen, that means a 50px x 50px-button will need a 100px x 100px-#2x-file.
Read more about retina icons in the iOS Documentation here.
You should round the origin of each image. If you place image with coordinate like (250.34, 340.21) you get blurry effect.
This is very likely to happen when you use automatic position calculation as well as center property to place your views/images.
In the simulator, use the new Debug menu to check whether your images are misaligned. If they are, use NSRectIntegral to fix their frames.
I have a Navigation controller in my app that pushes my homeview on load. The Home View has a subView which actually has the content (I plan to put another iAdBannerView later). The contentView(SubView) has a background image which is aligned with some text/label on the view to give a better look. Everything displays correctly in simulator (3.2 and higher versions).
I installed this in a 3.1 iphone device last night and it looks like the background image gets cut off from the top. It is almost like the view started at the correct position (after navigation bar) but the background image started from the top.
There is unfortunately no simulator for iOS 3.1 so I'm not able to reproduce this anywhere except the device. Even if I could reproduce, i'm not sure how to fix this because everything seems to be set up correctly. Is it a bug in 3.1. If anyone has experienced anything like this, could you please share?
Not sure what really happened. but I was able to change the height property of the content view to 520 or so and it started working fine.
I'm currently developing an app that has a camera functionality, with a custom camera screen, featuring a preview screen and an overlay.
I'm using the AVFoundation classes and methods as per the eradication of UIScreenCapture.
The problem I have is that the preview data I get from AVCaptureSession is too zoomed in. If i take a picture with that screen, and another with the iPhone's default camera app, without moving the iPhone, the difference in zoom is far too much.
I need the zoom of my app to be the same as is default for iPhone camera app.
I've tried changing the AVCaptureVideoPreviewLayer.videoGravity, to any of it's 3 possible values, to no avail.
Please, any leads on this problem are truly appreciated.
Arcantos' solution was mostly correct. That will work assuming you're on an iPhone 3G (or any device with a camera that supports 640x480). An iPhone 4 may run into some issues there.
A more correct way would be to test for the availability of and apply this preset:
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
This will use the raw camera data, regardless of the native resolution.
Turned out to be a resolution issue.
It was fixed by using
myCaptureSession.sessionPreset = AVCaptureSessionPreset640x480
Note that iPhone 3g does not support that, so you have to ask wheter the device supports it
[[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] supportsAvCaptureSessionPreset:AVCaptureSessionPreset640x480]
Is the aspect ratio of your preview pane identical to that of the camera capture data? If not, the OS may be changing the zoom to fit the data rect into your requested aspect ratio.
Apple recently decided to allow developers to use this UIGetScreenImage private API.
I have implemented it and it works fine in portrait, but when I run the device to landscape (self.view rotates) and UIGetScreenImage continues to capture using the screen non-rotated coordinates.
The result is a cropped landscape result.
UIGetScreenImage is the only method that works in my case, as far as I know and until you guys don't find an answer to this other question of mine :-)
I believe you need to apply the rotation yourself.
UIGetScreenImage() doesn't care about the orientation. In fact it cannot, because there can be multiple UIWindows on screen while some are autorotated, some are not.