quartz-graphics

[iPhone SDK] Edit alpha of cgimage on touch

Hello, I have two uiimageview, i need to have the imageview transparent under the touch point..(with a circle)...to be able to see the image under the first one.. Can you share me some code or examples? Thanks! ...

drawing images and lines over UIScrollView

I'm programming an app in which one of the ViewControllers is showing an UIScrollView that shows an image. I'd like to load an image (pushpin in png format) and draw it (and delete it) in some points of the UIScrollView image. I'd also would like to draw bezier paths in that image (and deleting them). I've programmed several apps but...

Analyzing bitmaps produced by NSAffineTransform and CILineOverlay filters

I am trying to manipulate an image using a chain of CIFilters, and then examine each byte of the resulting image (bitmap). Long term, I do not need to display the resulting image (bitmap) -- I just need to "analyze" it in memory. But near-term I am displaying it on screen, to help with debugging. I have some "bitmap examination" cod...

Quartz 2D: draw from a CGContext to another CGContext

I have a CGBitmapContext (bitmapContext) and I would like to draw some rectangle part (rect) of it to the current CGContext (context). Right now I do that way: CGContextRef context = UIGraphicsGetCurrentContext(); CGImageRef cgImage = CGBitmapContextCreateImage(bitmapContext); CGContextClipToRect(context, rect); CGContextDrawImage(cont...

Extending a view to the left side, animated

Hi, I have a view that I want to extend on the left side using an animation. All borders but the left one should remain the same, so the x position and the width of the view are changing. I use this code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:5.0]; self.frame = CGRectMake(self.frame.origin.x-100, ...

What's the difference between using Quartz & C vs ObjectiveC to load images?

In the Resource Programming Guide it gives 2 methods to load image resources, using Quartz & C vs ObjectiveC . Can anyone tell me what the difference is? Are both identical in terms of performance with a large number of images? ...

Draw over screen with Quartz

Hi, I'm trying to work out what the best way to draw over the top of all other items on the screen on OS X. I don't want to impede the user's ability to interact with their applications, but want to 'annotate' them. I want to be able to draw up to 20 different annotations. The top half of this screenshot from Gizmodo happens to nicely s...

What's a good approach to implement a smudge tool for a drawing program on the iPad?

At a high level (or low level if you'd like), what's a good way to implement a smudge affect for a drawing program on the iPad using Quartz2D (Core Graphics)? Has anyone tried this? Thanks so much in advance for your wisdom! UPDATE I found this great article for those interested, check it! ...

Quartz PDF API Causing Out of Memory Crashes

I'm having crashing issues using the Quartz PDF API for iOS. At the moment I am compiling with the SDK 4.0 GM Seed and running on my 3.2 iPad (I have tried using the 3.2 SDK with identical results). All the code I am using is based on the standard Apple Quartz documentation and from various sources around the internets. So I can't image...

How to write a web based music visualizer?

I'm trying to find the best approach to build a music visualizer to run in a browser over the web. Unity3D is an option, but I'll need to build a custom audio import/analysis plugin to get the end user's sound output. Quartz does what I need but only runs on Mac/Safari. WebGL seems not ready. Raphael is mainly 2D, and there's still the i...

Core Graphics OR OpenGL ES for 3d texture drawing

So here is my Objective : Suppose I have a photo of my house... I want to create a wall or fence out side my house on my garden... but i want to see how it looks before creating it. So 1> User selects type of structure (wall, fence, sideways, etc etc ) 2> User selects Texture type/Color etc 3> User choose the Path Or area 4> user ...

How can I easily change the overall opacity of a bitmap context using Quartz2D?

I'd like to create a fade out affect with one of my bitmap contexts that I use to draw a static image in one of my views. What's an easy way to adjust the overall opacity of the bitmap context on the fly before I render it to the view? Thanks so much in advance for your help! I'm going to continue researching this right now. ...

How can I easily change the overall opacity of a CGImageRef using Quartz2D?

This question is similar to another question I just posted, but I'd also like to create a fade out affect with one of my CGImageRefs that I use to draw a static image in one of my bitmap contexts using CGContextDrawImage(mBitmapContext, imageRect, imageRef). What's an easy way to adjust the overall opacity of CGImageRef on the fly before...

How do you load a local jpeg or png image file into an iPhone app?

Or I should ask why is it so difficult for me? The answer is probably that I'm new to iPhone development and I'm trying to ditch my old methods and step into the new platform of the future. From start to finish, I have a few questions about this process... If I create a .png image, where does it go in my project's directory (i.e. my ...

PDF pages with quartz

Hello guys! Here's my code for getting the pages from a pdf document and create a pdf document with each page: - (void)getPages { NSString *pathToPdfDoc = [[NSBundle mainBundle] pathForResource:@"security" ofType:@"pdf"]; NSURL *pdfUrl = [NSURL fileURLWithPath:pathToPdfDoc]; CGPDFDocumentRef document = CGPDFDocumentCreateWithURL((CFUR...

Perfromance Issues In CGContextDrawLayerAtPoint in iOS 4.0

I'm having some performance issues calling CGContextDrawLayerAtPoint in iOS 4 that didn't seem to exist in previous version of the OS. I'm copying a layer obtained from a bitmap context created with CGBitmapContextCreate to my view's context during a drawRect call. The view and the bitmap are the same size. The bitmap was created with...

Free Type font in pdfs on iPhone

Hello guys! Here's my code to create a PDF file from a CGPDFPageRef. + (void)createPDFFromPDFPage:(CGPDFPageRef)page withFilename:(NSString *)filename { CGRect pageRect = CGPDFPageGetBoxRect(page, kCGPDFMediaBox); CFStringRef path = CFStringCreateWithCString (NULL, [filename UTF8String], kCFStringEncodingUTF8); CFURLRef ur...

How to pass values from uitextfield to CGAffineTransformMakeRotation

CGAffineTransformMakeRotation(90); How can I send mytextfield.text to CGAffineTransformMakeRotation like : CGAffineTransformMakeRotation(mytextfield.text); ...

Quartz -- sometimes it starts from a blank view and sometimes it doesn't

I have in front of me two Quartz iPhone apps. In each of them, calls to setNeedsDisplay cause a view to redraw itself. But there is an important difference. In one case (the "Quartz Fun" app from the Mark/Lamarche book "Beginning iPhone development"), the view starts out blank each time. In the other case (the app I am working on), t...

PDF Parsing in iPhone

Hello friend, I am trying to read a PDF on iPhone, I got to know that we can get the info about PDF from CGPDFDocumentGetCatalog method. But, this method returns a CGPDFDictionaryRef. I have browsed through the documentation and didn't find any method to extract its Key/Values. Please help me if anybody has solution for the problem. Or ...