quartz-2d

Porting Quartz 2d python demo to pure Core Graphics C

Hi folks, let me first off noting that I have absolutely no idea what I'm doing with objective-c and mac development (though I'm fine with c). I made a wonderfully simple graphics utility on leopard with the Quartz-2d binding for python: http://developer.apple.com/graphicsimaging/pythonandquartz.html that basically inputs a text file ...

Saving Quartz drawings rendered over PDF on iphone OS

In my app I am displaying PDF pages and want to allow the user to "mark up" the document by freehand drawing on top of the page. I can handle the Quartz code for doing the freehand drawing, but what approach can I used to save these "mark ups" so that they can be re-displayed over the page the next time the user loads the PDF into the a...

Why is my CGContext clipped to bounds?

Should I be able to override drawInContext() and draw outside the bounds of my CALayer? Even though my layer has maskToBounds set to NO (the default) my drawInContext() is called with a clip set to the bounds of my layer and I am unable to draw outside of it. My test layer does something like this: -(void)drawInContext:(CGContextRef)co...

How to get a glow effect in Quartz for the iphone ???

I am searching for a glow effect in quartz 2d for the iphone. I tried making lines with different alpha values to simulate glow but it didn't work... Can anyone help me with that ?? p.s. I'm making an app where the user can draw with glow. I have the basic lines, but no glow :( ...

Why isn't Quartz double buffering my drawInContext()?

I am rendering a simple line drawing (a line with some text in the middle) in a CALayer subclass via drawInContext(). I update this layer as the user is performing a gesture by calling setNeedsDisplay on it. The effect that I am seeing is what I might expect if there were no double buffering going on... i.e. I see parts of new renderin...

Alternative to CGPathGetPathBoundingBox() for iPad (iOS 3.2)

I'm trying to get my head around using QuartzCore to render semi-complex text/gradient/image UITableViewCell composites. Thankfully, Opacity will let me visually build the view and then spit out source code to drop in to cocoa touch. Trouble is, Opacity assumes the code is running on iOS 4, which is a problem if you want to draw Quartz...

Editor for 2D graphical elements in iPhone App

Hi, I am going to be working with a graphic designer to develop an interactive children's iphone app. It will not be a game as such, but rather a series of backgrounds with some interactive objects that can be touched to display simple animation or sound. These I would be striving for the quality that these guys produce http://duckduck...

Where I can get hyperlinks in pdf document structure (except "Annots" entry in page dictionary)?

Hi, I have two pdf documents (doc1 and doc2) with hyperlinks e.g www.somlink.com, www.somlink2.com. According to PDF Specification I can get those hyperlinks via Link Annotations. Link Annotations can be found in pdf page's dictionary under "Annots" key. CGPDFDictionaryRef pageDictionary = CGPDFPageGetDictionary(someCGPDFPage); CGP...

How can I determine if two paths in Quartz 2d intersect?

If I create two paths in Quartz 2d, is there a way to determine if they intersect? Vaguely thought one could make a context and set one path as the clipping path, then draw the other path through that; but then how to determine if the resultant path is empty? ...

Why is Quartz 2D text flip transform required on iPhone

From the Apple docs: In iOS, you must apply a flip transform to the current graphics context in order for the text to be oriented as shown in Figure 17-1. A flip transform involves inverting the y-axis and translating the origin point to the bottom of the screen. Listing 17-2 shows you how to apply such transformations in the drawRect: ...

Make an image black and white?

Hello everyone! I have another quartz 2d (iphone) question: How to change all the colors of an ImageView to black and white and leave only red ??? DD ...

Getting PDF document outline

I'm using Quartz 2D to render PDF on the iPad, this works fine. Now I need a way to get the document outline (table of content), I found the following function CGPDFDocumentGetCatalog which seems to be relevant, but the returned info is an opaque dictionary from which I don't know the keys. I want the outline in a tree with the page nu...

How to create a CGPath from a file — i.e. SVG

Is it possible to create a CGPath from a given file? SVG would be preferred, but anything will work. ...

How do I join two different colored lines using Quartz?

So according to Apple's Quartz 2D Programming guide, there are a number of predefined line join styles when connected line segments in your path meet at a corner (Miter Join, Round Join, Bevel Join). I'm looking to do this with different colored lines, which I'm having trouble with. According to the discussion here: http://stackoverflo...

Looking for the better way to make a kind of PDF reader w/ iOS 3+

Hi, I'm trying to make an iPhone application which can read PDFs in full screen and follow links on PDFs, but I can't find the right way to do it. First, I tried to use an UIWebView to read the PDF file, but it doesn't work exactly as I wanted (I was'nt able to fix the link problem). The second solution was to use the Quartz API to re...

Is kCGImageAlphaNone faster for bitmap drawing on the iPhone

Is using kCGImageAlphaNone any faster or slower than using kCGImageAlphaPremultipliedFirst as the color format when using CGImageCreate() for fast animation frame rendering from bitmaps. Does double-buffering the bitmaps used between alternating frames help with load-on-write memory paging performance? ...

Seeing malloc allocating large chunks of memory - trying to track down why (iPhone)

I'm seeing my app being killed by iOS with an out of memory message, however, while tracing the progress of the app in the Allocations Instrument, I see lots of mallocs that seem to be occurring outside of the code I've written. I'm not seeing any leaks being caught, so I assume these allocations are supposed to be there. Thing is, beca...

Setting a CGPDFObjectRef to value

Does anyone have a way to change the information contained in a CGPDFObjectRef? Basically since CGPDFObject can represent any of the subtypes (CGPDFInteger, ie.) you would think you could set an existing CGPDFObjectRef that is type integer to an integer; however, I have played with this for quite some time with no success and was wonderi...

Is this the best way to draw large images to a UIView?

The app I'm working on requires me to draw images to a UIView. These images are large (some are 1024x768), and I'd like to be sure my drawing code isn't sub-optimal. My drawRect method in my UIView looks like this: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextClearRect(context, rect)...

PDF creation on the iPhone with Quartz --> Font integration problem

Hello everybody, has anyone ever managed to create a pdf on the iPhone, containing text (in whatever kind of font) which could be rendered by all/most pdf viewers. I recently created a pdf with Quartz, containing some text and had to make the experience that it renders correctly on my Mac only. I stumbled accross a few threads in differe...