quartz-graphics

How can I save a Bitmap Image, represented by a CGContextRef, to the iPhone's hard drive?

I have a little sketch program that I've managed to throw together using Quartz2D, but I'm very new to the iOS platform and I'm having trouble figuring out how to allow the user to save their sketch. I have a CGContextRef that contains the sketch, how can I save it so that it can later be retrieved? Once it's saved, how can I retrieve ...

CATiledLAyer and Memory usage (IPHONE SDK)

HI there. I've tryed to develop a little magazine reader for IPAD I use a subClass of CAtiledLAyer whit drawInContex Method and I draw the pdf pages into a scrollView. So i've 2 problem, 1-when i try the app whit simulator all work fine but when i try the app on ipad the layer drawing it's slow , 2-the memory usage allways increases a...

Draw a line in iPhone , Exception

Im trying to draw a line . I wrote a code like below. UIColor *currentColor = [UIColor blackColor]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, currentColor.CGColor); CGContextMoveToPoint(context, startingPoint.x, startingPoint.y); CGContextAdd...

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. ...

CGPDFDocumentCreateWithURL is giving me 0x0 nil

Hello, I have file test.pdf in my Application Bundle. I run test in iPhone Simulator (iPad) and I cannot get the CGPDFDocumentRef populated. Am I going crazy or what?!? here is a piece of code from the sample application made especially for this (ViewController class): - (void)viewDidLoad { [super viewDidLoad]; // below code to...

How do I draw a rectangle with clipped, not rounded, corners on the iPhone?

I saw many examples of how to draw a rounded rectangle using iPhone SDK. What I really need is a trimmed corner rectangle, something that will look as follows: Thanks, Josh ...

Open flow with using a slider in ipad

I need a cover flow in the ipad.I have implemented the cover flow application using http://apparentlogic.com/openflow. But it uses mouse to flick the images. I need the same also using a slider. How can i do it??? ...

Drawing shadow with Quartz is slow on iPhone & iPad. Another way?

I was pretty excited when I found out just how easy it is to add shadows to my UIViews on the iPhone/iPad. Just add the framework in Xcode, add the import to the top of the file: #import <QuartzCore/QuartzCore.h> Then later: self.contentView.layer.shadowRadius = 3.0; self.contentView.layer.shadowOffset = CGSizeMake(-2.0, -3.0); self...

iOS4, XCode linking problems

I'm having problems using the QuartzCore framework. Here's the code that's trying to run: #import <QuartzCore/QuartzCore.h> CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunc...

How do I programmatically provide a glossy look to UIButtons?

I would like to add 3D or glossy look to some iPhone UIButtons, but do so without the use of PNGs or stretchable images. I have a lot of buttons of varying shapes and sizes with lots of colors which are generated on the fly, so prerendered images are not feasible in my case. How would you go about drawing the gloss on these buttons pro...

How to scan links in a PDF document?

How can I scan links in a PDF Document? Do I have to use Quartz? Which methods/functions? ...

How to use CGPathApply properly

I'm trying to use CGPathApply to iterate over each CGPathElement in a CGPathRef object (mainly to write a custom way to persist CGPath data). The problem is, each time it get to the call to CGPathApply, my program crashes without any information at all. I suspect the problem is in the applier function, but I can't tell. Here is a samp...

Embedded PDF links with Quartz

I want to display my PDF using quartz on iPad. Quartz does not seem to recognize the embedded links though. Is their a solution to this? ...

UIImage+Resize.h - wrong affine transformation given for UIImageOrientationUp orientation

For the UIImage resize I used the following class. http://iphone.svn.wordpress.org/trunk/UIImage+Resize.m But I am having issues in some iPhone orientation where I keep the phone in lined with a vertical surface. It does the resize properly but the image is not properly affine transformed. The image orientation is different. I logged t...

iPhone - Draw transparent rectangle on UIView to reveal view beneath.

I currently have two UIViews: one of a red background and the other blue. The blue view is a subview of the red view. What I would like to do is be able to "cut" out rectangles on the blue view so that the red view can be visible. How do you go about doing this? ...

Drawing polylines over Image in UIImage View

Hi! I want to draw polylines over and image loaded in an UIImageView. Can someone give me some tips on where to start? Thank you ...

CGImage (or UIImage) from a CALayer

Hi all, I have created a CALayer (I added several shapes to the layer, but ultimately, I have a single CALayer), and I am having a LOT of trouble adding it to a CGImage. I have found some references to [CALayer renderInContext:ctx], but I am not sure how to implement it. Has anyone done this before? Cheers, Brett ...

CGContextSetRGBFillColor is not setting the good color.

My problem : the color of the fill in square go from black to full blue (255) with no transition color (darkest blue, dark blue, blue...). It seems that the CGContextSetRGBStroke is additive (WTF Oo) . like if the blue was 14 and the next update I put 140 the blue will be 154 and not 140 has I set. Is someone get that problem ? in the ...

CALayer and Off-Screen Rendering

I have a Paging UIScrollView with a contentSize large enough to hold a number of small UIScrollViews for zooming, The viewForZoomingInScrollView is a viewController that holds a CALayer for drawing a PDF page onto. This allows me to navigate through a PDF much like the ibooks PDF reader. The code that draws the PDF (Tiled Layers) is lo...

Curve text on existing circle

For an application I am building I have drawn 2 circles. One a bit bigger than the other. I want to curve text between those lines, for a circular menu I am building. I read most stuff about curving a text that you have to split up your text in characters and draw each character on it's own with the right angle in mind (by rotating the ...