uiimage

CGImageRef to UIImage rotates my photos debugging on a iOS 4 in simulator or device.

I have a problem with some simple code. The photo's, either picked or taken with the camera, are rotated. At first I thought it was a setting in the UIView but it happens when I copy the passed in UIImage to another UIImage using CGImageRef. I did it this way as it was the easiest way to ensure I was using a copy. Correct this code i...

converting uiimage to negative colors 2nd time crashes the app

Hi! I want show an animation with a negative image and a normal image. To start, the getPhoto method is called and the user can get an image from library or take one with the camera. When the animation is running I want to be able to set the image to a new one, but then the app crashes. -(IBAction) getPhoto:(id) sender { UIImagePi...

iPhone 3G/4 - UIImage resize and preserve fill question

Hi, I am using the resize and preserve aspect ratio code from here http://stackoverflow.com/questions/1282830/uiimagepickercontroller-uiimage-memory-and-more/3261445#3261445 but I am noticing an issue with left/right orientation. When you resize an image from the camera source (I tried on 3G and 4), and when the orientation is right ...

How to create a UIImage with working alpha channels from other UIImages (iPhone)

Hi All, I would like my iPhone app to take a UIImage from the image library, image roll or live camera, and then create a new UIImage with the pixels and alpha channels of the pixels altered. (For example, if a source pixel is close to black, then make it more transparent than a brighter pixel.) I have code that will create a CGImageR...

Memory Map UIImage

Hello, I have a UIImage and I would like to put its data in a file and and then used a mapped file to save some memory. Apparently, the UIImage data is private and it's not possible to access it. Would you have any suggestions to solve that? Thanks! ...

Get Pixel color of UIImage

How can I get the RGB value of a particular pixel in a UIImage? ...

Retina display and [UIImage initWithData]

Hi folks, I need to initialise images from raw data downloaded from a server which delivers the correct size of image based on the type of iPhone client. I know that I should be setting the scale value to be 2.0 on the 640x960 display, however this is a readonly property and cannot be set during the init when using initWithData. Any i...

UIImage masking gives black background on the iPhone (and not in simulator)

Hi there, I've got mask images w/o alpha channel, pure black and white with a black polygone on the center sourrounded by white. I've got png's image that I'd like to mask. the png have got an alpha channel. using the method here below : ok on simulator, but background is black on device ... any idea to fix that ? - (UIImage*) maskIm...

Why is drawAtPoint Creating Duplicate Images in my tablecell's contentview?

I have a view with a custom slider. We are using a subclass of TableViewController that is generating instances of UITableViewCell. Inside each tableViewCell we add our custom slider (a UI View) as a subview. In here we have a view that serves as the slider's control knob. It is just a subclass of UIView with a gesture recognizer. The dr...

UIImage created from CMSampleBufferRef not displayed in UIImageView?

I'm trying to display a UIImage in real-time coming from the camera, and it seems that my UIImageView is not displaying the image properly. This is the method which a AVCaptureVideoDataOutputSampleBufferDelegate has to implement - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer...

UIImagePickerController and the need to save the UIImage asap vs. exploiting the file backing

I've read uiimagepickercontroller uiimage memory and more and other relevant questions, but I can't get my head around one thing, and I wonder if there are people around here with experience on this particular aspect. In my app I let the user select an image from his library, ultimately resulting in an upload. (An interesting thing here...

ipad scrollview causing malloc of 40x the image's size

Bear with me as I am new to obj-c but I have a UIScrollView and a segmented button that switches between 2 images that are presented in the scrollview. Each image is large and roughly 500Kb, but they are each causing allocations of 20+ MB and crashing my app. - (void)viewDidLoad { [bvpiscrollview setContentSize:CGSizeMake(768, 248...

What happens to an expired [UIImage imageNamed:] object?

As the title says, suppose I instantiate an UIImage object with imageNamed:.. this creates and returns a pointer to an autocached UIImage object, correct? What happens if the frameworks decides that its cache needs to be purged (for whatever reason, though most likely running low on memory) ? Do I just get stuck with a dead pointer? ...

Avoid streching of UIImage inside my UIImageView

Hi. I'm loading an UIImage UImageView. The UImageView has identical width and length, and when I load an UImage it gets streched. Is there any way to load my UImage inside my UImageView without change in its proportions ?, I want the image to fit inside my UIImageView without deformation. Thanks. ...

How to make image Disappear on touching it ?

hi, I am working on apllication for iphone in xcode 3.1. I want similar two images to disappear when touched one after other. I have succeed in displaying two images on iphone simulator on touching 'PlAY' button. Now i want that when two same images are 'touched' one after another,they should disappear. Expect code in Objective C. ...

load photo from device in iOS4

Hi,guys. i want to load "amount of UIImages" from PhotoAlbum at a time and display on the UIView. in iOS3 ,it may like : NSString *file_path = @"/var/mobile/Media/DCIM/100APPLE/" NSArray *imageSource = [fileManager contentsOfDirectoryAtPath:file_path error:nil] ; UIImage *image = [UIImage imageWithContentsOfFile:[imageSource objectAt...

New Images Can't Be Found in iPhone SDK

Hello, I've been trying to update an image that is packaged with my app, but the app refuses to load the new file. I originally had a png called "board.png". I then created a new file which is a higher resolution copy of the original. I deleted "board.png" from the Resources group in XCode and added the new image under the same name. W...

iPhone SDK - What is the fastest way to grap an image from the camera and resize it to screen size?

Since UIGetScreenImage() is banned again I'm looking for another fast way to get a 320x480 image representation of the current camera picture. What would be the fastest way to downsize the image from didFinishPickingMediaWithInfo and save it as an jpg? ...

Maximum size of UIImage tiles for iPhone 4

I have an iPhone app containing a large static image, which is sliced into 1024x1024 tiles and put in an UIScrollView. I'm not clear whether I can use larger tiles on the iPhone 4. If I want to support a double-res image for iPhone 4, should I: Create 2048x2048 tiles with a @2x suffix or Create 4 times as many 1024x1024 tiles and writ...

Loading image from url problem iphone

Hi all, I'm loading images from url into webviews but that's showing me images which are cut down. I tried doing sizeToFit, but that shows a very small image cornered at left in my webview as the webage is large and image at its upper left corner. EDIT: This' how I'm loading images in webview. Here, expanded_photo is webview. NSStr...