In my application,I used PhotoLibrary,it get photo, small part of that image.In full image it picks only the corner part.i searched over the net it tells,it checks the device size and image size return device size image only.then how it is possible to bring whole image.
Many photos are larger than the screen size. Corona can only show what's on screen. You have two choices, put the larger image inside of a widget.newScrollVew() so you scroll around and see the larger image, or scale the image down until it fits on the screen.
Related
everyone. For the App on which I am working I want to let users be able to select own image and set it as the background of App. The Problem I face is how to let users crop the image fitting the size of device's screen if the image is larger. Another question is if users want to select a pretty small image and set it as the background, should I just say no to it?
We don't know how you've set up your app so we can only speculate. BUT you could create a UIImageView that is behind everything else. When the user selects a picture just set that picture to that image views background....
As for the cropping...if you use constraints and tell that image view to be 0 from top, 0 from left, 0 from right, and 0 from bottom it will automatically resize based on size of device. Also you would need to set that image views scale property so the image doesn't distort...
Finally, usually when you have images on the device you create a 1x, 2x, and 3x size and Xcode will automatically use the appropriate size ...but again we have no idea how your app works...so if the user is trying to use an image that is 15 pixels by 15 pixels and have it fill the whole screen...it's going to look pixelated
You might want to write a function that gets the image size and if it fails to meet specifications you set...tell the user somehow (UIAlert...)
All of that being said...
Folk here on Stack Overflow generally don't take time to help on questions that have no code example shown...generally speaking you attempt to figure it out first and then post...so show code that you've tried, or take a screen shot of how your View Controller looks like...
We have a background image for our app that needs to be full screen for each device we run the app on. Our problem is the background image is tiling on our iPhone 6S+ (Display Zoom off).
I have drawn in red lines to highlight where the tiling is occurring...
We have created 3 background images of the following sizes...
So, designing for 1x (which is the recommended way to go), our base level 1x background image is 320 pixels wide. Our 2x is 640 pixels, and our 3x is 960 pixels.
The problem is the iPhone 6S+ is 1080 pixels wide and according to this chart, you need to start with a 3x image that is 1242 pixels wide. And this is where I am missing how this is supposed to work.
from https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
With the above chart in mind, it seems you need a separate image for each resolution highlighted with a red square in the above image. Is this correct? And if yes, how do you label each individual image so that at runtime the correct one is picked?
Three images, named as you have them for background.png, are all you need.
Now let's talk about image views. They display their image using a content mode. The key thing is to pick the correct mode. Aspect Fill is what you probably want here, because it will fill the image view without distorting the image.
One procedure, then, is to use a bigger image than what you have, and configure the image view that shows the image to use an appropriate content mode such as Aspect Fill, so that it sizes the image down to fit (or, to save memory, at runtime you can size it down yourself).
The other possibility would be to leave your image as it is, and solve the issue on the Plus machines by telling the image view to size the image up to fit, again possibly by using Aspect Fill. That might or might not look acceptable; you'd have to try it and see what you think.
I have a very simple requirement here but I'm looking for a solution for a while. I want to take a profile picture form the camera roll or camera and display it in two different image views (different sizes). I don't want any of these images stretched or miss any part of the image. If I use aspect to fit, top side of image is cut from smaller image view and some parts missing on the bigger image view. If I set it as scale to fit, it will get stretched!
I'm not sure how some mobile apps work. Do they save different image sizes in their server or they change the size of the image. I saw many posts how to change image size without changing aspect ratio. But I don't think it is possible to avoid stretched effects. I used some of those code to change size of image, it gets stretched all the time.
Is there any way to save the image from camera roll one time with size of 140*200 and one time 160*200? So I can use 140*200 for image views that size. But what if I have different devices and different sizes.
I'm making my first iphone game using swift/xcode with gimp to draw the graphics. I'm having trouble understanding what size I should make the image in gimp to use it for the background of my iphone game.
The various devices have different screen sizes, so presumably you will want your image to adapt. Thus it really isn't about your image but about the image view that will display it (assuming you're using an image view). The things to think about are:
How to use constraints to pin the edges of the UIImageView to the edges of the screen.
How to set the content mode of the UIImageView so that it displays the image acceptably on all device sizes.
I'm using Nimbus to display a photo album with scrubber and zoomable image view. I use network images, and display a thumbnail until the final image is loaded. NIPhotoAlbumScrollView provides the method didLoadPhoto:atIndex:photoSize: to accomplish exactly that.
From the source code comments, the NIPhotoScrollView should support that "image crisping effect" - showing thumbnail and when full-size image is loaded, sharpen the image without loosing the zoom state.
This feature seems broken though. When the thumbnail is loaded, it is displayed in its 1:1 pixel size, which is very small on screen. When the full-size image is loaded, it is also loaded in its 1:1 pixel size (if smaller than the available view size), which makes the image visually jump bigger.
Any idea on how to fix that issue?
Note that I tried both with a full sized image with dimensions bigger or smaller than the size of the NIToolbarPhotoViewController on screen.
you may already be doing this, but one thing to make certain:
where you implement photoAlbumScrollView:photoAtIndex:photoSize:isLoading:originalPhotoDimensions: for protocol NIPhotoAlbumScrollViewDataSource, you must do the following, as mentioned in these comments in the source:
* If you have a thumbnail in memory but not the full-size image yet, then you should return
* the thumbnail, set isLoading to YES, and set photoSize to NIPhotoScrollViewPhotoSizeThumbnail.