Graphics
How to Crop an Image
This post shows an example of one way to crop an image. Let’s begin by looking at a screenshot of the original and cropped image on the iPhone simulator: As you can see, I am cropping a rectangle from the middle of the image on the top left. The code below shows how to accomplished [...]
Convert an Image (UIImage) to Grayscale
A trick you won’t need often, yet when the day arrives, you’ll have this up your sleeve – a quick method to convert a UIImage object to grayscale.
Resize/Scale of an Image – Take 2 – Coding a Thread Safe Approach
In the first post on image resizing, How to Resize/Scale an Image using an Objective-C Category, I wrote barebones approach to resizing an image. This works well for simple cases, however this approach is not thread safe as it uses the global current context. I attended a recent Apple Tech Talk and one of the [...]
Gotcha: Case Sensitive PNG Filename
Here’s one that will trip you up if you aren’t careful…look at this code: timerButton = [[UIButton alloc] initWithFrame:CGRectMake(104, 410, 50, 50)]; // Notice the filename "timer.png" [timerButton setBackgroundImage:[UIImage imageNamed:@"timer.png"] forState:UIControlStateNormal]; [timerButton addTarget:self action:@selector(buttonPressed:) forControlEvents: UIControlEventTouchUpInside]; [self.view addSubview:timerButton]; Simple enough, create a button, use the image timer.png for the normal state, and [...]
Resize/Scale of an Image – Take 1 – Using an Objective-C Category
Editor’s Note: Part 2 of this post Resize/Scale of an Image – Take 2 – Thread Safe Approach takes this idea to the next level, showing how to dynamically resize images using thread safe code. Given how common it is to scale an image within an application, it’s surprising (at least to me) that such [...]
Animated Gif – Animated Images – iPhone Style
Using animated gif and animated images with the iPhone SDK.
Creating iPhone Icons
I’ve been poking around for a decent tutorial on how to create icons for the iPhone. Specifically, I am looking for a walk through with either PhotoShop or FireWorks. The icon I have in mind is what will be shown on the home screen of the iPhone as well as on the App Store. The [...]








