Image looks blurry after start of the app - iphone

I use an image with some buttons on it in my iPad split view app. When the app starts in portrait mode, the image looks a bit blurry. When I rotate it to landscape and back to portrait, it looks crisp.
Why?

Your UIImageView has certainly an autoresizingMask that make it being placed at, for example, 0.5;0.5, or being resized so that your image is scaled.
In interface builder, under the Size Inspector (ruller icon), try tweaking parameters to get the effect you want

Related

How to switch the live screen camera icons from portrait to landscape mode in iPhone?

I created a custom camera overlay for the live screen camera view and have imported my own custom icons for the camera, flash and flip buttons. Everything looks good in portrait mode, but when I switch the live camera screen to landscape mode, the orientation of the camera stays in portrait mode and shows this in console,
"Error: CGAffineTransformInvert: singular matrix"
I tried using the auto resizing mask, also have tried setting two different frames for the icons in both portrait and landscape mode in didRotateFromInterfaceOrientation method. But none of these are working.
My question is, will the landscape orientation support only the default iPhone camera overlay view or will it also support the custom overlayview.
Here are the screenshots indicating the behaviour of the icons repositioning each other when switched from portrait to landscape mode. I want exactly like this in my custom overlay view.
Edit:
I've made the live screen of my custom camera overlay to change by using the UIDevice Orientation method. But right now, the frame is not resizing when i try to switch from the portrait to landscape mode. So, i just want the entire frame to resize in landscape mode. Also, in this piece of code, if i try to change the value of CAMERA_TRANSFORM_Y,
#define CAMERA_TRANSFORM_X 1
#define CAMERA_TRANSFORM_Y 1.234
self.picker.cameraViewTransform = CGAffineTransformScale(self.picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
the size of the overlay view reduces both from the top and bottom margin. But, more size gets reduced from the bottom than from the top margin. I want the overlay size to change uniformly both from the top and from the bottom margin.
This is my sample code,
Sample project

How to keep image size when changing iPhone orientation

I have an image that's 575x300px with text inside it.
While the iPhone is in the landscape position everything's dandy, but change the orientation to portrait and the image 'shrinks' in size (resolution change?) and the text becomes unreadable.
Is there a way to maintain the image size for both orientations?
Edit - I'm talking about a web page, not an app.
Set the view's contentMode to the value you would like. You probably want a value like UIViewContentModeScaleAspectFill.
try to set the autoresizing mask property for the UIImageView to UIViewAutoresizngmasknone.

presenting same image in all orientations in fullscreen

I was just wondering how can I set up a gallery in landscape and portrait mode, and show the images as normal in both modes (not stretched or squashed). The only way I can think of is having the same image in both sizes so it can be shown the one that suits the orientation. This idea appears "dumb" to me so if someone knows a better way to set an image view in all orientations please give me some advices
Landscape and portrait are different aspect ratios. If you don't want to stretch or squash the images, you can either crop the image or letterbox it.
Cropping is where you don't show the entire image, for instance an image that covers the entire screen in portrait would have the top and bottom removed.
Letterboxing is where the entire image is shown, but with a solid colour surrounding the image. For instance, a landscape image shown in portrait would have black areas above and below the image.
It's relatively easy to do the above on the iPhone by selecting the correct content mode options in Interface Builder.
You can also supply different images as you describe, but that would just mean that you'd be cropping or letter boxing manually.
You should look at the contentMode property of your image view (or any UIView subclass, for that matter). Set it to UIViewContentModeScaleAspectFit, which will size the content of the image view to fill as much of it as possible without distorting the aspect ratio or clipping anything. In this case, just set the image view to be as large as possible, and the content mode will handle the rest.

How code in program for display same image view whatever orientation?

I want to show same image view whatever u have mode either portrait or LAndsacpe mode.5n my case when i change my UIView then image frame in scroll layout frame don't show same image it start from image no.1 but i required same image no. when i change orientation. So for that what will i do ?
It sounds like you're having problems with scroll views when the orientation changes? Have a look at this answer I posted a while ago (example code included).

Question about using landscape mode with custom images on the iPhone/iPad

Hey I just had a simple question about implementing landscape mode for an app, particularly running on the iPad (but I am sure the concept holds true for the iPhone). I have a custom background image that I am wanting to use for my root view. I designed the image so that it fits the iPad screen size for portrait mode. Do I need to design a second image for landscape mode so that it fits correctly? Is that how the landscape/portrait transition works, switching between two different images? I really don't have any idea, so any help would be appreciated. Thanks!
One other thing to think about is that the UIImage class has stretchableImageWithLeftCapWidth:topCapHeight: method to take an existing image, and build a new image that can adjust to any size by repeating only the central portion of the image and leaving the corners of the image as fixed image segments.
You can load in a fixed UIImage, generate a stretchable copy using this method, and assign it to a UIImageView - then as you resize the UIImageView due to rotation, the image will adjust as needed and not resample the image.
Assuming you have a UIImageView as your backdrop, change its image property after the device orientation changes.
See Handling View Rotations in http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html