iOS, size of images for background - ios

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.

Related

image background files for iPhones

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.

UIView manipulation for collage like picture in high resolution

I'm currently working on a collage application where users can combine multiple images into one collage (in a grid like layout, like 2x2). I worked on a couple of examples where coders used a UIView to which the images were added as Subviews. The subviews itself are zoomable and scrollable, so that the images can be adjustet inside their boxes.
The results are then exported as a JPEG reprensentation. While the results are okish, the problem is that output from the UIView only is as big as its screen size (640x640 for a 2x Screen on an iPhone 4 / 5). I was wondering if there would be better way to maybe compose a higher resolution image from the original image sources with consideration of the changes made in the view.
The View

Adaptive Layout Full Screen Image

Using Adaptive Layout, what is the best or recommended approach for displaying a full screen background image to ensure it works on all devices, both orientations?
Is it a case of making an image the largest possible size (iPad Pro) and then scaling down?
Also, how would you handle screen rotation? Manually detect this and rotate image?

Camera/photo gallery in corona sdk

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.

Dynamically resize background image according to different screen size

I displays a splash Screen when my app loads,There is a background image in the splash screen,I problem is how can I make fit this image in all types of blackberry models?
Keep in mind that many BlackBerry devices have different screen resolutions and even different aspect ratios. So if you just use a single image and resize (stretch and/or squish) it to fit the current screen, you're going to distort the image (or pattern). As I see it, there are two main approaches:
1) Use a different image for each screen resolution. There are about 7 different resolutions that cover most of the in-market devices (240x260, 240x320, 320x240, 360x400, 360x480, 480x320, 480x360)
2) If it's a regular background pattern as opposed to a picture or logo, just have one image in the app that's big enough to cover the largest screen size (480x360) and for all other screen sizes just clip it. In fact, I think this should happen automatically if you just set the background image - anything that can't be displayed on the screen will be clipped.
While approach #2 is better in terms of reducing application size, I'm going to guess that since you're asking this question the background you're thinking of using isn't a regular pattern.
I think the simplest method would be to use the setBorder method of whatever screen/field needs a stretched background. For example:
Border b = BorderFactory.createBitmapBorder (new XYEdges (), bitmap);
field.setBorder(b);
In my experience this results in the background image being stretched and provides the simplest method for fitting the size you need. I have only ever used it for fields though and never a MainScreen so it might not work for you.

Resources