quartz-graphics

Getting a CGImage out of a PDF file

I have a PDF file where every page is a (LZW) TIFF file. I know this because I created it. I want to be able to load it and save it as a bunch of TIFF files. I can open the PDF file with CGPDFDocumentCreateWithURL, and get a page. I can even draw the page onto the screen. What I WANT to do is draw the page into a bitmapContext, so that...

Quartz 2D/OpenGLES geometric distortions on images (preferrably using CGImage)

What is the preferred method for implementing such geometric distortions as pinch/fisheye/etc. using the iPhone SDK? I know that the Core Image library for OSX has all these types of filters built in, but not for the iPhone SDK. I can create a displacement map at a specific location and radius given the original source bitmap data, but...

iPhone image distortion

Are there any reasons why the simulator will display UIImageViews properly, but incorrectly on the iPhone? My Process: An image in a PNG file Start a UIGraphicsBeginImageContext() Draw the PNG in a CGrect Draw text in the CGRect Create an UIImage from the context Set the image of a UIImaveView to the UIImage Set the frame of the UIImag...

QuartzCore.framework problem

I am trying to use QuartzCore Framework but when adding this framework to my iPhone application, I am told that the files (e.g. CIColor.h and others) are missing but those missing files exist on my hard drive under /system/library/ In addition to the QuartzCore Frame work, I am using the following frameworks: cocos2d, cocoa.framework, o...

CIFilter available in the iPhone SDK?

This might be a dumb question, but I want to know for sure before I start implementing my own filters (probably using opengl ES) but are the CIFilters available on the iphone? Anything similar? Thanks ...

disabling color correction in quartz 2d

Ok, I know that it's not possible to actually disable color correction in quartz. What I'm looking for is a device-independent color space setting that dosn't change the RGB values I draw in a CGLayer. I tried all the ICC profiles from the system library, they all shift the colors. This is the best result I got: const CGFloat whitePo...

Quartz drawing optimization

I have a view that has a background image and a CGPath that gets changed as the user touches the screen. Drawing the image with CGContextDrawImage() and then drawing the path on top is not fast enough and it hinders the touch event performance. What I would like to have is to have a bitmap buffer and only draw the changes in the path to ...

How do I create a grid of icons like the iPhone home screen?

How should I go about creating a UI similar to the Springboard (home screen) on the iPhone? I'd like a grid of evenly spaced buttons with images where I can respond to the button tap. Is the UITable a good fit? Should I use a plain UIView and position the icons manually in DrawRect? Is there an alternative that will automatically evenly...

Font sizes in Core Graphics

Hello everyone, I'm trying to render a bit of text using Core Graphics APIs and I'm running into some conceptual difficulties. I'm trying to specify font size using CGContextSetFontSize. The size parameter is in something called "text space units". What is that? How does it map to "em" units? Thanks ...

Event taps: Varying results with CGEventPost, kCGSessionEventTap, kCGAnnotatedSessionEventTap, CGEventTapPostEvent

I'm running into a thorny problem with posting an event from an event tap. I'm tapping for NSSystemDefined at kCGHIDEventTap, then replacing the event with a new one. The problem I'm running in to is that depending on how I post the event, it's being seen only by some applications. My test applications are Opera, Firefox, Quicksilver, an...

My Quartz drawing on iPHone is clipped after rotation!

I'm drawing three rectangles, one of which falls off the end of the view, (i.e. the drawing is bigger than the current view bounds) so you don't see the right edge. This is good, but when the view is rotated, the right edge is still clipped, even though there's plenty of room to draw it. How can I get the view to redraw the full rectan...

Mac OS X: Can one process render to another process's window?

Greetings! I'm currently porting a web browser plugin from Win32 to MacOSX. One of the features of the plugin is that when the plugin is loaded, it spawns a separate process that serves as the "engine" of the plugin and executes drawing operations into the window of the plugin (specifically, by attaching an OpenGL context to the parent ...

Creating mask with CGImageMaskCreate is all black (iphone)

I'm trying to create an image mask that from a composite of two existing images. First I start with creating the composite which consists of a small image that is the masking image, and a larger image which is the same size as the background: UIImage * BaseTextureImage = [UIImage imageNamed:@"background.png"]; UIImage * MaskImage = [UI...

Can i move the origin when doing a rotation transform in Quartz 2D for the iPhone?

Sorry if this is obvious or covered elsewhere, but i've been googling all day and haven't found a solution that actually worked. My problem is as follows: I am currently drawing an image in a full screen UIView, for examples sake we'll say the image is in the bottom right corner of the UIView. I'd like to do a rotation transform(CGAffin...

How to draw signature with lines on iPhone screen?

I want to let user draw a signature on iPhone screen, so I add a subclass of UIView and add some code to its 'touchesMoved' method. -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; firstTouch = [touch locationInView:self]; CGSize mySize = CGSizeMake(5, 5); UIGraph...

iPhone Quartz2D: simple animation via delayed drawing

I'm trying to implement some very simple line drawing animation for my iPhone app. I would like to draw a rectangle on my view after a delay. I'm using performSelector to run my drawing method. -(void) drawRowAndColumn: (id) rowAndColumn { int rc = [rowAndColumn intValue]; CGContextRef context = UIGraphicsGetCurrentContext(); ...

How should I do multiple animations on the iPhone?

I'd like to animate multiple pieces for a game and i'd like to have those pieces move in different directions so my current method of animating an entire view will no longer work. I'm wondering what is the best practice for animating multiple items at once. (Note i'm rendering in 2d so i'm not currently interested in 3d soltuions.) Th...

What is the best way to draw this ellipse in an iPhone app?

I'd like to have a similar ellipse as the Mail app in my iPhone app. A screenshot just for reference is here: http://dl-client.getdropbox.com/u/57676/screenshots/ellipse.png Ultimately I'd like the ellipse with a numerical value centered in it. Is it best to use a UIImage for this task? Perhaps less overhead to draw it with Quartz? If i...

JPEG Quality when creating a JPEG in Carbon

I'm writing a Carbon application and we are creating JPEG files. I'm currently doing this by using Quartz CGImageDestinations and kCGImagePropertyJFIFDictionary. However, JFIF doesn't seem to have any entry for compression quality. Does anyone know how to set this? thanks ...

Quartz 2D drawRect method (iPhone)

I've got 4 different iPhone/Cocoa/Core Animation/Objective-C books in front of me, along with numerous sample code from the web. Yet somehow I still feel like I'm missing some fundamental understanding of how drawing works in Quartz 2D. Is drawRect() meant to simply be a hook in which to execute your drawing code? Or is this method s...