uiimage

Problems with sequential UIImage Animations

I am having a problem trying to animate between 2 UIImage. I did implement the setAnimationDidStopSelector methods so once my first animation is finish I start my second one, but when I tried to flip to my previous image it still flipping to the same image as if the variable didn't take into the account the new value of my image object ...

UIImage Shadow Trouble

I'm trying to add a small shadow to an image, much like the icon shadows in the App Store. Right now I'm using the following code to round the corners of my images. Does anyone know how I can adapt it to add a small shadow? - (UIImage *)roundCornersOfImage:(UIImage *)source height:(int)height width:(int)width { int w = width; int h = h...

Why does loading more than a megabyte of images consume all of my iPhone's memory?

I'm writing an application that needs to hold around forty 44 kb JPEGs in memory at once. I've heard that applications can use around 22 megabytes before triggering a low memory warning, so I'm pretty sure it should be able to do this. However, once I pass around a megabyte loaded, these messages start popping up in the console: Mon Ju...

iPhone - save image at higher resolution without pixelating it

Hi I am using the image picker controller to get an image from the user. After some operations on the image, I want the user to be able to save the image at 1600x1200 px, 1024x1024 px or 640x480 px (something like iFlashReady app). The last option is the size of image I get in the UIImagePickerControllerDelegate method (when using imag...

How to create a colored 1x1 UIImage on the iPhone dynamically?

I would like to create a 1x1 UIImage dynamically based on a UIColor. I suspect this can quickly be done with Quartz2d, and I'm poring over the documentation trying to get a grasp of the fundamentals. However, it looks like there are a lot of potential pitfalls: not identifying the numbers of bits and bytes per things correctly, not sp...

Removing image background in UIImageView at runtime

I have a ball assigned to a UIImageView in Interface Builder. An IBOutlet from the UIImageView is wired to a corresponding UIViewController. The image has a white background. When I assign it to the UIImageView in IB, the background is transparent. In IB, I have the UIImageView set to a transparent background and aspect fill. When ...

Most efficent way to create a CALayer with an image in it?

I am wondering what the most efficient way is to make a CALayer with an image in it. I know you can load a UIImage and then call [image CGImage] but is this the best way of going about it? As far as I can tell from Apple's documentation this is the only way you can do it. ...

Is there a way to analyze a UIImage's pixels?

I've got an Info Button (Dark) which overlays a UIImageView photograph (which the user makes with camera). The trouble is, if the photo is dark, then the button is almost invisible (because it's dark too). So, is there a way to get the color of the part of the image under the info button, so that I can change the info button to either d...

How can i split an image in to multiple parts ?

Can any body explain me how an image can be (equally and unequally) split in to multiple parts in iPhone OS. It is very helpful to me if you provide sample code. ...

Saving an image to the users preferences

Has anyone had any experience in saving app preferences (within app, not in Settings app) which involve images taken with the camera? The prefs include NSStrings, UIImage, BOOLs etc. The UIImage is a pic taken with camera. Could I store these all in an NSMutableArray and then just do something like this: [array writeToFile:[self dataF...

Fastest approach for rotating an image on the iPhone

I need to rotate a UIImage in response to user input. I'd like this to be as slick as possible and therefore would like to know which is the quickest way to perform the transformation and render. Ideally I'd like to stay within the UIKit or Quartz frameworks. The properties of the image are as follows: Size approximately 250x300 pixels...

How can I modify the pixel data of a UIImage on the iPhone?

I want to modify a UIImage on a pixel-by-pixel basis. I've found a couple of posts here and elsewhere about accessing the image data as a char* pointer. My twist is that I want to modify this data and then create a new UIImage based on my pixel data. Anyone done this before? ...

How can I adjust the RGB pixel data of a UIImage on the iPhone?

I want to be able to take a UIImage instance, modify some of its pixel data, and get back a new UIImage instance with that pixel data. I've made some progress with this, but when I try to change the array returned by CGBitmapContextGetData, the end result is always an overlay of vertical blue lines over the image. I want to be able to ...

Drawing UIImage into CurrentContext

Hi, in my application i've used a UIImagePickerController to take a photo, and after i took the photo, i cant't draw it using UIImageView because i want draw on it some lines with my finger; To this end I have written in draw rect methods this code: (void)drawRect:(CGRect)rect { [self.myimage drawInRect: rect]; //Disegno rettangol...

Inserting an NSString into NSBundle's pathForResource?

This animates the UIImageView in the impactdrawarray: if ( ((impact *) [impactarray objectAtIndex:iv]).animframe == 70){ ((UIImageView *) [impactdrawarray objectAtIndex:iv]).image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"explosionA71" ...

create UIImageView with portion of image file

I'm subclassing UIImageView to create a tile-based application. Essentially, I am taking a single image file and breaking it up into pieces, and then assigning the pieces to my tiles (UIImageViews), so that they can be manipulated independently. What's the best way to grab a portion of an image and use that to draw a UIImageView? I th...

Which IPhone control would be better?

I have a situation in which user can single tap a control, which show random images, to peek under it, double tap to mark it, or drag it to a box where it snaps to the box if more than half of its body is inside box. I was using UIbuttons (with background image) before and have done the single/double tap thing for them, how to do the dr...

iPhone: Masking an UIImage via touches

Hi, before rolling up my sleeves and starting an own solution: Is there already an approach for masking an image via touches? Touches are marked yellow in my example: If there is no existing solution, I will try it to inspect Apple's drawing sample app to get some selections on the image. ...

How to streamline my code - UIImage imageNamed:

Hi, More iPhone stuff... Does anyone know how I can trim this code down. So I don't have to write every single image. Thanks a lot bMon01.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"mon01_0001.png"], [UIImage imageNamed:@"mon01_0002.png"], [UIImage imageNamed:@"mon01_0003.png"], [UIImage ima...

iPhone - Corrupt JPEG data for image received over HTTP

I'm getting an image over HTTP, using NSURLConnection, as follows - NSMutableData *receivedData; - (void)getImage { self.receivedData = [[NSMutableData alloc] init]; NSURLConnection *theConnection = // create connection } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [receivedData app...