uiimage

UIImage that came from UIImagePickerController's photo library, is white image

Hello, When get UIImage that came from UIImagePickerController's photo library, i get white image, why is that? tnx ...

Replacing the content of UIImage(s) loaded from XIB at runtime

For a concept I'm developing, I need to load XIB files manually and by using class and instance method swizzling I have been able to intercept calls to imageCustomNamed, imageCustomWithContentsOfFile and imageCustomWithCGImage for the UIImage class and initCustomWithImage for UIImageView. What I want to to is detect the image name and re...

UIImage with Large image size - Memory Problem - Crash

I wanted to load and display image(.jpg,.png) having large size e.g. 1800x1200 or 2000x1800 (width x height). If I display such large size images (1800x1200 or 2000x1800) in UIImageView, it also consume lot of memory and application is getting crashed. Also as per Apple's documentation (http://developer.apple.com/iphone/library/documenta...

How to let an animation finish before the next userinput is allowed

Hello . I have some UIImageViews and when the user is touching, an animation with a certain duration starts. A trigger counts ++ and with the next touch another animation starts to play. But if the user touches to fast or make a doubletouch the first animation does not finish until the last frame. I tried the "sleep()" command, but it d...

How do I create an outline of an image (with transparencies) in a UIImage

Hi! I'm making a game where you can select some NPC's each NPC is an UIImage, and the png that is inserted in that component has transparencies, what I want to do is create an outline of a different color (say blue) of that NPC when it's selected. Thanks in advance!! (By the way I'm a newbie so, if you can post examples even better!!) ...

How to ignore transformations when drawing an image with drawAsPatternInRect:

I draw a background image in a view with the following code: CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextSaveGState(currentContext); UIImage *image = [UIImage imageNamed:@"background.jpg"]; [image drawAsPatternInRect:rect]; CGContextRestoreGState(currentContext); This works well. But when I change the size...

Resize NSData to set into UIImage

Hello everyone, I have these codes: UIImage * img = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:IMAGEURL]]]; [self.imageView setImage:img]; But the IMAGEURL contains a high resolution picture so it takes much time to load. Can I resize the image data smaller to load faster? Any help will be appre...

image downloading from URL in iPhone application

Hi All, I am using google chart functionality in iPhone app....I want to download image and put it into UIImageView from http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World ... Is there any sample app for doing such functionality?or any other way to display charts in app? Thanks in advance... ...

How to rotate UIImage in image center.

double angle = -15; UIImage *image = [UIImage imageNamed:@"test.jpg"]; CGSize s = {image.size.width, image.size.height}; UIGraphicsBeginImageContext(s); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextTranslateCTM(ctx, 0,image.size.height); CGContextScaleCTM(ctx, 1.0, -1.0); CGContextRotateCTM(ctx, 2*M_PI*angle/360); CGContex...

Image scaling with UIImageView on iPhone

I have a custom view which is composed of a number of UIImageViews. These UIImageViews can vary in size (from 200x200 down to 50x50). The images that they display (loaded from png files) are stored in resources at the highest possible resolution (200x200), but frequently are displayed at lower resolutions. Currently I just load the UI...

fetching current filename of the uiimageview

Hello everybody. I have an array of image file names. I load the image into uiimageview in a for loop. i have also kept a button on the background of imageview, so that when the thumb image is tapped, the full size image would be shown. I do the operation of loading the full size image on the button click function. My problem is how wou...

Lazy Loading UIImages from files without blocking main thread?

What's a decent way to load UIImages on demand without blocking the main thread? Context: I have a couple thousand images on a wall that I can scroll through. Obviously it's not feasible to just load all the UIImages, so right now I'm just lazy loading the ones that are getting displayed, and then releasing them when they're no longer n...

Iphone CGPDFDocument rendering incorrectly

I am creating a PDF Context and changing it to a UIImage to swipe through quickly. Currently some of the text is rendered strangely, seems to be all squashed together and ontop of each other line. The code I use is as follows: - (UIImage*)loadImageFromBundle:(NSString*)URL { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(...

How to convert NSData to CGDataProviderRef on iphone sdk?

I am getting EXEC_BAD_ACCESS errors in a CGContextDrawImage call and trying to trace it back. I have a PNG image and running a UIImagePNGRepresentation o it gives me NSData instance. I need to convert this to CGImageRef instance, so I can run the CGImageCreateWithPNGDataProvider method with this CGImageRef. I tried two ways: 1) To cast...

Need help in adding a drop shadow to an image in a uiview in iOS4?

I am trying to create a drop shadow for an image. I also have an animation between views and this is the backdrop. However, when I use the following code, the image is not drawn. Anyone have any ideas? self.frontViewBackground = [[[UIView alloc] initWithFrame:frame] autorelease]; //self.frontViewBackground.image = [UIImage imageNamed...

Image processing Glamour filter in iphone

Hello All, I want to create an app in which i want to do some image processing. So I would like to know if there is any open-source image processing library available? also I would like to create a filter like this one Glamour Filter any help regarding this would be very much appreciated. If someone already have a source code to create s...

[iPhone] image width and height was exchanged after load to CALayer

I want to put an image into a CALayer's sublayer, like this: CALayer *parent = [CALayer layer]; CALayer *child = [CALayer layer]; [parent addSublayer:child]; UIImage *image = [UIImage imageWithContentsOfFile:imagePaht]; NSLog(@"%f-%f", image.size.width, image.size.height); child.contents = [image CGImage]; I have five images in my ...

How to non-deforming rotate an image in UIImageView in UIView when device rotates?

Hi everybody, I have a UIView with this structure inside it: UIView -- UIImageView -- -- UIImage The JPG image is vertical, and it's the same size of the device in the vertical orientation. I want the UIImage to rotate this as follow: Device is vertical: The image is shown full size (fills the screen) Device is horizontal: - The im...

iOS: how to determine whether to download a normal or hires retina image?

Since the iPhone 4 came out, Apple has put forward the @2x filename technique to easily implement higher resolution pictures. That's great, but how about dynamic image downloading? Indeed, in my application I would like to avoid image scaling and unnecessary big downloads as much as possible, which could negatively impact the performanc...

Objective C: EXC_BAD_ACCESS when generating a UIImage

I have a view that generates an image based on a series of layers. I have images for the background, for the thumbnail, and finally for an overlay. Together, it makes one cohesive display. It seems to work a dream, except for when it doesn't. For seemingly no reason, I get an EXC_BAD_ACCESS on the specified line below after it's generat...