quartz-graphics

iphone: Drawing over MKMapView?

Hi guys I'm attempting to draw polygons on a mapView. What I did was to add a transparent view on the main view, that matches the bounds of the mapView, and I draw over it. When I move the table it's ok, but when I zoom in and out the polygones 'bounce' on the Y axis (latitude) but the x axis is ok. What do you think? BTW I tried to a...

iphone sdk: I have a Quartz Drawing problem

Hi guys, I have a view (MKMapView) and on it I've a transparent view on which I draw different things. Now I would like to give the user the option to erase things so that the "background view" (the mapView) will be seen in the erased places. Do you think it's possible? Thanks ...

Moving a UIView along a CGPath according to touch position

I have a line graph I've drawn in Quartz, and a UIView 'bubble' that I'd like to ideally pop up when the user touches the single plot line, and moves their finger along it. The bubble displays some extra graph information. I'd like to 'attach' the UIView to the CGPath plot, but I'm having trouble conceptually figuring out the best way t...

Change Screen Resolution in Snow Leopard

I've been plugging away at this for a few hours now, and haven't found a good answer. In Leopard, I can programmatically change the screen resolution using Quartz Display Services with CGConfigureDisplayMode. Unfortunately, this has been deprecated in 10.6. This seems like a simple task: how can I change the screen resolution with non-d...

Get union of the frames of several transformed UIImageViews?

I've got a collection of roughly 10 overlapping UIImageViews. Each one is rectangular but each is rotated and scaled separately. Are there any Core Graphics tricks for drawing a path around the perimeter of ALL the images? CGRectUnion may give me a rectangle encompassing all the views (though I vaguely remember the frame is undefined o...

Overlaid images

I'm creating an application where I will be drawing two circles onto the screen, one large circle with a smaller circle inside. I want the user to be able to touch/drag on the screen inside or outside of the large circle and it will move the smaller circle in that direction. If the user touches outside of the large circle the smaller cir...

Where can I find examples of Quartz 2D drawing on the iPhone?

Hi, I am going to develope the 2D game in Iphone using Quartz. what is the main Difference between Quartz and QuartzCore? I have searched a lot over the internet, but only able to find out the MAC OS with Quartz Examples. If any body has any Link/URL for Examples of Quartz(2D) using Iphone Developement,which would be run in the Real ...

Find a point between two point

I two concentric circles on the screen and I want the circle on the inside to move around while the user drags their finger around the outside of the larger circle. This means that I have two point, center of the larger circle and the point at which the user touched. How do I calculate where the center of the smaller circle should be? ...

CATiledLayer blanking tiles before drawing contents

All, I'm having trouble getting behavior that I want from CATiledLayer. Is there a way that I can trigger the tiles to redraw without having the side-effect that their areas are cleared to white first? I've already subclassed CATiledLayer to set fadeDuration to return 0. To be more specific, here are the details of what I'm seeing an...

Thread Safety Of Custom Sequential CGDataProvider

When creating a custom sequential CGDataProvder to render a custom image format you specify the CGDataProviderSequentialCallbacks that should be used. While doing some optimization work to improve the speed of my sequential CGDataProvider I started to wonder about the thread safety of those callbacks. Let's assume I have created a si...

iPhone: optimized drawing in quartz

I have created a CG context that is 800 pixels wide and 1200 pixels height. I have created CGLayer over this context that has been transformed (scaled, translated and rotated). So, at some point, as the CGLayer is bigger than the context and has been translated, rotated, etc., not all parts of this CGLayer falls inside the context. See n...

CALayer filters and bounds

Hi, I'm just starting writing some Core Animation code and I've just spent a frustrating day trying to figure out a particular problem. I have two layer-backed views that together make up a wizard/ assistant style user interface: 1) a custom background view that fills the entire window with an edge-to-edge gradient and a nice image on...

IPHONE: CGLayer using 17 times more memory as expected

I have created a 800x1200 context using this line: CGSize sizeX = CGSizeMake(800, 1200); CGLayerRef objectLayer = CGLayerCreateWithContext (context, sizeX, NULL); over this context I have a CGLayer that is 2250x2250 pixels. This layer (objectLayer) is drawn using something like CGRect LayerRect = CGRectMake(0,0, layerW, layerH); CGC...

OSX Quartz Event Taps: event types and how to edit events

Here's my code: #import <ApplicationServices/ApplicationServices.h> CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { printf("%u\n", (uint32_t)type); return event; } int main (int argc, const char * argv[]) { CFMachPortRef eventTap; CFRunLoopSourceRef runLoopSource; even...

IPHONE: memory still allocated after releasing object???

Hi, I have a method for drawing an object offscreen to a file, using quartz. The last lines of this method are: CGRect LayerRect = CGRectMake(mX,mY, wLayer, hLayer); CGContextDrawImage(objectContext, LayerRect, objectProxy.image.CGImage); // 1 CGRect superRect = CGRectMake(vX, vY, w,h); CGContextDrawLayerInRect(context, superRect, ob...

How do I release this CGPath when I need to return it

I have a method that returns a CGMutablePathRef, something like this: - (CGMutablePathRef)somePath; { CGMutablePathRef theLine = CGPathCreateMutable(); CGPathMoveToPoint(theLine, NULL, 50, 50); CGPathAddLineToPoint(theLine, NULL, 160, 480); CGPathAddLineToPoint(theLine, NULL, 270, 50); return theLine; } The Xcode/Cla...

iPhone Quartz curve jaggy and has dark border

I've got a weird issue with quartz. The first time I run the piece of code below, the line will be drawn like the line to the right in the image. The second time (and every time after) these lines are executed, the line will look like the line to the left. Why does it look like that? It's all jaggy and seems to have a dark border. If you...

How to save and read a CGLayerRef, in a NSmutableArray

Hello, i have a question about the CGLayerRef "elements" ( because they are not object !) In my app, i want to store a list of CGLayerRef created from bitmaps, for obtain a good framerate on my DrawRect. how can i store and read the CGLayerRef in this code ? This is the code for store in the NSMutableArray CGLayerRef imageLayer; ...

Problem with linking QuarzCore

Hello, I am new with Objective C and iPhone development but that is what I am trying to do... Problem is with QuarzCore and basic animation stuff. These lines are from my applicationDelegate: #import "QuartzCore/QuartzCore.h" ... -(void)performTransition { if(!transitioning) { CATransition *transition = [CATransition anim...

Export CGPath as JPG or PNG

Is it possible to take a path draw in an UIView with CGPath and export it as a PNG? ...