rectangular uibutton from a single square image - iphone

From inspecting latest facebook and expedia iphone app, I can see the developers have used a single squared image which gets scaled up in run time into rectangular shape.
Can anyone share some code on how to do this programmatically in conjunction with the square image?

You are probably looking for this . Here's another one: Stretchable Images and Buttons

Related

upload and preview as repeated background image

I am searching for a tool on web but didnt got any success their at all. I want to have something like upload and preview the image as background as repeated one or any other alternative...
I have this sample:
How can I preview and cut the image as a perfect background image as repeated one. Is it possible in Photoshop or in some similiar products?
The trick i have recovered is crop a part of the image in a big canvas of Photoshop and then making the deuplicate copies of the layers...
If the image seems like irregular it means the cropped image is wrong so you have to change with a other or larger part of the image...
If it is regular and doesn't cut at the side onto the edge, it means image is perfect making background repeated...
Thanks...

How to make view like in the image attached?

I want to implement the UI feature as in the image attached. The image is an screen shot form a Siemens App that is in App store. Here the bright portion can be rotated like wheel. I have gone through the link
http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit.
but I am not able to implement the feature as in image.
Following is the link to download the Siemens app.
http://itunes.apple.com/us/app/siemens/id452698392?mt=8
The simplest approach I can think of is to use two images. One would have the green and white detail display and one would be gray with a slight circular gradient, a lot of transparency, and a fully transparent segment.
The gray image would go on top and handle touch movement by rotating and taps according to its last stop position.

Cutting image within an image with Corona SDK

I was wondering if it's possible to cut an image within an image with the Corona SDK using your finger? If it is indeed possible, I'd like to know how. It's for an iphone game. Thanks.
There are two ways you can do this.
One is to replace the image with two halves of the original.
You will need to edit the image, which is cumbersome.
Second is to use bitmap masks as alpha masks.
The masks are grayscale images: white = show, black = hide.
This method won't require you to change the image.
Create two halves of the original image.
Hide half of each image shown here as A & B
using 2 separate alpha masks.
Sample Code from Corona here
This would assume your image would always be sliced in the same way.

iOS Trim Square Image to make rounded app like in app store

I'm grabbing app images from the iTunes affiliate program. Unfortunately Apple provides a square .jpg image which does not have the smooth rounded edges. How can I programmatically take the provided image and round the edges?
The only way I can think of how to do this is set the image as the background of a view, and then round the layer borders until it cuts off what I don't want to see. Is this a good approach?
I don't see any problem with that approach, I was going to suggest the same thing.

Interface Builder vs. What's Displayed on iPhone

Hello and thanks for giving this question a gander.
It seems that PNG files that I drag/drop into IB do not display in the same manner that they are shown in the iPhone simulator. What gives? For example, if I want to drop in a PNG with rounded corners, IB shows hard rectangular corners but when I build to the simulator, I see the rounded edges.
I don't understand the purpose of IB for UI if I can't accurately reflect what will be shown for that view.
Can you verify that the PNG files are saved with a pixel density of 72dpi? Also, what type of UI element are you using? (UIButton, UIImageView, etc). It would help if you could post a sample image.