quartz-graphics

iphone: how to do Page turning

hi frnds, I am facing the problem from a month and didn't find anything from google.. I am using UIView for pdf display. there is no problem with pdf but problem is with transition. I have to turn each page of pdf with realistic page turn exp. I search, dig a lot about that but i didn't get anything that how to do that. I don't want t...

simple CATextLayer scaling problem

I'm having a simple scaling problem with CATextLayer, but i just couldn't figure it out: I want the CATextLayer to proportionally grow in size with it's superlayer: if the superlayer's width is 300 the text size of CATextLayer should be 12 and if the supeview's width is 600 the text size should be 24. I couldn't find a working solution! ...

How can I draw a shadow beyond a UIView's bounds?

I'm using the method described at http://stackoverflow.com/questions/805872/how-do-i-draw-a-shadow-under-a-uiview to draw shadow behind a view's content. The shadow is clipped to the view's bounds, although I disabled "Clip Subviews" in Interface Builder for the view. Is it possible to draw a shadow around a view and not only in a view? ...

Not drawing outside bounds when clipToBounds=NO

I am drawing lines on a map, and I notice that my annotation view isn't covering the entire area of the lines (which is fine, as long as I can draw outside the bounds of the view). Here is a picture of what I'm experiencing. The clipToBounds property is set to NO for the annotation view, and I've added a semi-transparent color to the b...

Problem draw line by Quartz 2D with alpha property < 1.0 on iPhone

Hello Everybody ! This code i use to draw in my app. So i have problem, if i draw with alpha property = 1. It is very good but if i change alpha property = 0.2 then my paint is not good. How do i make for better with alpha property = 0.2. http://www.flickr.com/photos/9601621@N05/page1/ Draw with alpha = 1: It is good Draw with alpha =...

How to draw a rounded rectangle in Core Graphics / Quartz 2D?

I need to draw an outline for a rounded rectangle. I know I can make lines and arcs, but maybe there is also a function for rounded rects? ...

iPhone: Is Quartz 2D the only way to generate PDF files?

I can't convert an HTML file for example? ...

Quartz2d vector images vs OpenGL vector description?

How big of a difference is the description language of Quartz2d to OpenGL ES? It seems they are similar in description power... except that Quartz is mostly 2d and that OpenGL is out of the box 3d ( but can be made 2d focused ). Are the mappings from 2dQuartz to 2d OpenGL ES that different? Im sure there must be differences in some sp...

CGPath and Quartz 2D

I want to create a triangle using Quartz 2D functions. The 3 edges of the triangle should be in different colors. I am able to create the triangle but not able to set the color of each edge or subpath separately. Any suggestions or sample code are much appreciated. ...

Change animation time for properties of a CALayer.

I have a CALayer to animate a change in its image contents. Now, how can I change how long it takes for this animation to take place? ...

Can't block capslock with CGEventTap

I'm using Quartz CGEventTap in an attempt to globally intercept capslock presses and block them (to have them do something useful instead). I succesfully detect capslock presses but have so far been unable to block them. My code (originating from this stackoverflow answer) is something like this: eventTap = CGEventTapCreate(kCGHIDEventT...

Image animation over CGContextDrawPDFPage

I have a pdf page displayed with CGContextDrawPDFPage in QuartzDemo sample application. I want to keep this page shown and have an image slide in from top over this page, just as it can be seen in the iBooks application. It's a book, the sliding image is a bookmark that slides in when you are about to close the book. I added this code...

Image animation over CGContextDrawPDFPage

I'm modifying the QuartzDemo sample app from Apple. In QuartzViewController.m I have modifications (by DyingCactus) which replac the back button and add a method to handle the back button press as follows: -(void)viewDidLoad { // Add the QuartzView [scrollView addSubview:self.quartzView]; //add custom back button if this i...

Touch draw in Quatz 2D/Core Graphics

Hello, I'm trying to implement "hand draw tool". At the moment algorythm looks like that (I don't insert any code because methods are quite big, will try to explain an idea): Drawing In touchesStarted: method I create NSMutableArray *pointsArray and add point into it. Call setNeedsDisplay: method. In touchesMoved: method I calculate ...

Drawing path by Bezier curves

Hello. I have a task - draw smooth curve input: set of points (they added in realtime) current solution: I use each 4 points to draw qubic Bezier curve (1 - strart, 2 and 3rd - control points, 4- end). End point of each curve is start point for the next one. problem: at the curves connection I often have "fracture" (angle) Can you t...

Can't compile code when working with CALayer

For some reason I get linker errors when I try and use CALayer: "_OBJC_CLASS_$_CALayer", referenced from: I have imported the following headers: #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> Code: arrowImage = [[CALayer alloc] init]; ...

Will you publish your app without device testing?

Hello, me and my friend develop iPad application (a lot of CoreGraphics stuff). But we can't find an agreement. I tell him that testing on device is essential, he tells me that testing on iPhone 3G/3GS will be enough (I have both devices). Can you tell me, probably we really can test our app on 3GS? The main thing is that interface will...

Add shading to clipped UIView

I'm creating an iphone application. I have this UIView whose content is clipped with a path. I want to add shading and/or shadow to it. What's the best way to do this? For shadow, I tried CGContextSetShadow() but it doesn't seem to have an effect (perhaps it's drawing outside the shown region?) . How about shading? I want it to appear al...

How to fill a path with gradient in drawRect:?

filling a path with a solid color is easy enough: CGPoint aPoint; for (id pointValue in points) { aPoint = [pointValue CGPointValue]; CGContextAddLineToPoint(context, aPoint.x, aPoint.y); } [[UIColor redColor] setFill]; [[UIColor blackColor] setStroke]; CGContextDrawPath(context, kCGPathFillStroke); I'd like to draw a gradient...

CGContextSetShadow() - shadow direction reversed between iOS 3.0 and 4.0?

I've been using CGContextSetShadowWithColor() in my Quartz drawing code on the iPhone to generate the "stomped in" look for text and other things (in drawRect: and drawLayer:inContext:). Worked perfectly, but when running the exact same code against iOS 3.2 and now iOS 4.0 I noticed that the shadows are all in the opposite direction. E....