uiimage

Each Image in AFOpenFlow the same size?

Good morning to all, i have now the following method that shows the AFOpenFlow: NSString *imageName; for (int i=0; i < 10; i++) { imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i]; imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]]; CGRect frame = [imageView frame]; frame.size.w...

NSURL code to display an image from a sqlite table

Ii'm using this NSURL code to display an image. what I want to do is to insert a url from my database table in place of the static url shown in the code below: Does anyone know how I should proceed? NSURL *url = [NSURL URLWithString:@"http://www.nyapplecountry.com/images/photosvarieties/redrome04.jpg"]; UIImage *image = [UIImage imageW...

Loading a Localized UIImage

I need to load localized images in my iOS app, but also have to take into account that they might need to be the ...@2x kind. How can I do this? ...

Easiest, fastest way to render UIImage/PNG using OpenGL on iPhone?

I've written an iPhone application that takes input from a user and updates a bitmap context based on the input. After the update, it then updates the display of a UIView. I am accomplishing such by implementing drawRect in a UIView subclass. Currently I am using Quartz 2D. Given that the updates are occurring multiple times per second,...

Setting a UIImage border

Is there a way to set borders to a UIImage. I know how to set it for UIImageView, but my problem is the UIImage that I load up in a UIImageview wont be of the same size or aspect ratio as the UIImageView. Hence Ive kept the UIImageView mode to aspect fit. Giving a border to UIImageView now would border the entire UIImageView rather than ...

A UI control for Ipad to brose a list of images

Hi I have made the decision to use monotouch to develop an application that browses an rss feed and displays a grid of images much like browsing the picture library actually on the device. My issue is that I have NO idea (even after extensive googling) as to what control I should use. I want to be able to swish through the list of im...

[iPhone] Persisting an array of images

What's the best way to save and retrieve an array of images across app restarts? I'm implementing a caching feature for offline viewing of downloaded images and just want to make sure I'm using the right persisting methods. Thanks! ...

Evaluate darkness in a UIImage

I would like to run a calculation to see if the bottom 20px of a UIImage are generally dark or light. I am displaying a small amount of text on top of this image (one line at the bottom, ie. the bottom 20px), and would like to determine dynamically whether I should make this text black or white. I am guessing I should be able analyze ea...

UIImage CGImage: message sent to deallocated instance

Following is a snippet of my code: in the .h file: @property (nonatomic, retain) UIImage *photo; @property (nonatomic, retain) NSData *photoData; in the .m file: @synthesize photo; @synthesize photoData; ... photo = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; {*} ... NSLog(@"b1"); self.photoData = UIImagePNGReprese...

iphone - single UIImage multiple UIImageView?

Hi all. I have a single image that needs to be placed on multiple UIImageView. I am wondering whether there is a way to save the memory in doing this? For e.g., I have a pic file. I can create one UIImage object for this file. If I create multiple UIImageView and init them with the single UIImage Object, will that save the memory? t...

[iPhone] Convert UIImage to CVPixelBufferRef

Hi @ll I want to convert a UIImage object to a CVPixelBufferRef object, but I have absolutly no idea. And I can't find any example code doing anything like this. Can someone please help me? THX in advance! C YA ...

what is the difference between UIImageView and drawInRect?

Hi, I want to display so many images in table cells. I knew two methods to show an image. One is creating an instance to UIImageView and show it CGRect rect=CGRectMake(x,y,width,height); UIImageView *image=[[UIImageView alloc]initWithFrame:rect]; [image setImage:[UIImage imageNamed:@"sample.jpg"]]; Another method is, CGRect rec...

iphone - Scaling Images are very slow - Help

Hello All I am scaling images by myself using the following codes. The code is fine and the images are scaled without problem. UIImage *originImg = img; size = newSize; if (originImg.size.width > originImg.size.height) { newSize = CGSizeMake(size.width, originImg.size.height * size.width / originImg.size.width); } else { newSi...

Catching error: Corrupt JPEG data: premature end of data segment

When creating an UIImage with corrupt/incomplete JPEG data, the console will print out <Error>: Corrupt JPEG data: premature end of data segment The incomplete image will be shown, with grey filling up the incomplete part. I do not want this to happen. I desperately tried with a try-catch block but it does catch the error. Is there a...

Loading an ico image switches red channel with the blue one

Hello, This is what I do: I have a favicon.ico in my resources (for example http://google.com/favicon.ico) Then I have a UIImageView which loads that image. self.imgTestIcon.image = [UIImage imageNamed:@"favicon.ico"]; The image showed in the simulator or the in iPhone is the same but with the red color switched with the blue one. C...

Dynamically loading images in UIImageView from database in objective c

I have saved my images in database with type BLOB. Now I am extracting these images from database using sql stmt and saving it in a NSData object. see the following code snippet NSData *img = [[NSData alloc] initWithBytes:sqlite3_column_blob(loadInfostmt, 4) length: sqlite3_column_bytes(loadInfostmt, 4)]; self.birdImage = [UIImage ima...

UIImage from photo library very large

Hi everyone! In my game I'm grabbing an image from the iPhone's photo library using the UIImagePickerController, which returns a UIImage. Because the image is a huge resolution (1536x2048), this UIImage takes up almost 20mb in memory. To resolve this, I shrink the image significantly before using it to generate a sprite and this works i...

How do I make an exact copy of a UIImage returned from a UIImagePickerController?

I have divergent needs for the image returned from the iPhone camera. My app scales the image down for upload and display and, recently, I added the ability to save the image to the Photos app. At first I was assigning the returned value to two separate variables, but it turned out that they were sharing the same object, so I was gettin...

Good way to use CGImageCreateWithImageInRect, UIImage and UIImagePickerController questions

Hi All, I'm trying to do something which should in theory be quite simple, but I've been chasing my tail around for days now. I'm trying to take a touch event from a screen overlay, capture an image, and crop a section of the image out around where the finger touched. Now all my code is working fine, the overlay, events, cropping etc....

How to make UIButton use a masked image correctly?

I’m creating a UIButton programmatically and then adding a masked image with setImage: CGRect photoFrame = CGRectMake(11, 11, 180, 120); UIButton *cardPhotoButton = [[UIButton alloc] initWithFrame:photoFrame]; cardPhotoButton.backgroundColor = [UIColor clearColor]; UIImage *cardPhoto = [[UIImage alloc] init]; cardPhoto = [self maskImag...