cgbitmapcontextcreate

UIView: how to do non-destructive drawing?

My original question: I'm creating a simple drawing application and need to be able to draw over existing, previously drawn content in my drawRect. What is the proper way to draw on top of existing content without entirely replacing it? Based on answers received here and elsewhere, here is the deal. You should be prep...

iPhone - UIImage Leak, CGBitmapContextCreateImage Leak

Alright I am having a world of difficulty tracking down this memory leak. When running this script I do not see any memory leaking, but my objectalloc is climbing. Instruments points to CGBitmapContextCreateImage > create_bitmap_data_provider > malloc, this takes up 60% of my objectalloc. This code is called several times with a NSTim...

iPhone - UIImage Leak, ObjectAlloc Building

Alright I am having a world of difficulty tracking down this memory leak. When running this script I do not see any memory leaking, but my objectalloc is climbing. Instruments points to CGBitmapContextCreateImage > create_bitmap_data_provider > malloc, this takes up 60% of my objectalloc. This code is called several times with a NSTimer...

iPhone - CGBitmapContextCreateImage Leak, Anyone else with this problem?

Has anyone else come across this problem? I am resizing images pretty often with an NSTimer. After using Instruments it does not show any memory leaks but my objectalloc just continues to climb. It points directly to CGBitmapContextCreateImage. Anyone know of a solution? or Even possible ideas? -(UIImage *) resizedImage:(UIImage *)i...

iPhone - Multiple CGBitmapContextCreateImage Calls - ObjectAlloc climbing

Has anyone else come across this problem? ObjectAlloc climbs as a result of the CGBitmapContextCreateImage. Does Apple's software not fully releasing the objectalloc? I am resizing images 12 times a second with a NSTimer. During resizing of the image I am also adding a photoshop like Gaussian blur effect by including interpolationQuali...

iPhone: Changing CGImageAlphaInfo of CGImage

I have a PNG image that has an unsupported bitmap graphics context pixel format. Whenever I attempt to resize the image, CGBitmapContextCreate() chokes on the unsupported format I receive the following error (error formatted for easy reading): CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; ...

Error With CBitmapContextCreate, CGContextDrawImage, CGBitmapContextCreateImage

Error: CGBitmapContextCreate: invalid data bytes/row: should be at least 400 for 8 integer bits/component, 3 components, kCGImageAlphaNoneSkipFirst. Error: CGContextDrawImage: invalid context Error: CGBitmapContextCreateImage: invalid context Currently, I have in application that runs perfectly in OS 4.0, but I have been trying to get...

CGContext & CGBitmapContextCreateImage errors, how to fix?

I've been at this for hours now, and don't even know how to debug this error. Maybe there's an SO expert who knows what's going on. - (void) prepareSubset { CGSize size = [image size]; float scale = fminf(1.0f, fmaxf(SUBSET_SIZE / cropRect.size.width, SUBSET_SIZE / cropRect.size.height)); CGPoint offset = CGPointMake(-cropRect.origin....

How to prevent unsupported parameter combination on CGBitmapContextCreate?

In my iPhone app, I download images from a web site. I would like to resize and crop these before saving them, but CGBitmapContextCreate tells me that the images have "unsupported parameter combinations". I guess I would have to convert my images to one of the supported formats before using CGBitmapContextCreate, but how do I do that? ...

Help please with CGBitmapContext and 16 bit images

I'd LOVE to know what I'm doing wrong here. I'm a bit of a newbie with CGImageRefs so any advice would help. I'm trying to create a bitmap image that has as it's pixel values a weighted sum of the pixels from another bitmap, and both bitmaps are 16bits per channel. For some reason I had no trouble getting this to work with 8bit images b...

saving images in lower quality(256, 16, 4, 2 colors) - cocoa

Hi. I am trying to work with images in Cocoa - open images and manipulate with them. I take ImageApp as example . All work fine, but I need to save images in lower quality -(8, 4, 2, 1 bits per pixel - 256, 16, 4, 2 colors respectively). According to documentation, the "lowest" pixel format is Gray 8 bpp, 8 bpc,kCGImageAlphaNone and i...