Question: I've written a VB .Net program that does selective intensity pixel modification on graphic files. It's a lot faster than it was when I started (20 seconds vs 90 seconds), but the total time to process multiple images is still slow. I typically run 64 12 MP images, and it takes about 24 minutes to process them all. I thought that if I use multiple threads, each thread processing a subset of the total image set, I could speed things up, so I added multiple background workers. But when I run multiple threads from the program with Thread#.RunWorkerAsync(), the saved images are screwed up. Here's a "good" image, run in a single thread:

<http://freegeographytools.com/good.jpg>

And here's a typical example of the same image when two threads are running:

<http://freegeographytools.com/bad.jpg>

These results are essentially typical, but the "bad" image has a clean stripe near the bottom that looks correct; that doesn't normally appear on most images.
Each thread calls its own subroutine with independent variables, so there should be no variable "cross-contamination". While these results were obtained with images saved as JPG, I've gotten the same results with images saved as TIF files. I've also tried separating the images into different directories, and processing each directory simultaneously, each with its own thread - same result. To modify pixels, I've used GetPixel/SetPixel to change the pixel value, and also used LockBits to modify the image in a byte array - results are the same for both methods. One thread good, two+ thread bad. I'm sure it's something obvious, but I can't figure it out. Suggestions would very much be appreciated.

Answer: 
Change the image's cap insets to make the image fit the way you want:

```
UIImage *barButtonImage = [[UIImage imageNamed:@"ZSSBackArrow"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,width,0,0)];

```

This will keep the width of the image as your specified width.

You may need to play with the numbers a bit to get it just right.
Using the background image property forces the stretching. Try using the image property and play around with the image inset/offset to position the image where you want it.