quartz-graphics

Why Lua is better for game developement than the iPhone Quartz framework?

I have seen lots of information about the Lua scripting language for game developement, but I don't understand why it's more powerful than the Quartz framework. What functionality does Lua give that Quartz does not? ...

What's the difference between Quartz Core, Core Graphics and Quartz 2D?

I wonder if someone can distinguish precisely between these? For my understanding, Core Graphics is just a "Framework Package" which contains Quartz Core and Quartz 2D. But I'm not sure about if Quartz 2D actually is Quartz Core? Maybe someone can draw some lines there? What makes up the differences between these? When looking at the do...

Can't load Quartz animation in screen saver: "You cannot use the XXX screensaver on this computer"

I've written a simple screensaver that loads a Quartz animation using a QCView. But when I install it on Snow Leopard it appears in the Screen Saver preview with a message saying "You cannot use XXX screensaver on this computer...". If I comment out the loadCompositionFromFile line (but leave the Quartz framework linked) it's fine. I ...

How to rotate text drawn by Quartz on iPhone

I want to draw some texts using Quartz. Now the app draws , but I want it to show as "0123456789". Is there any way to show its normal orientation? Here is my code: //set image view drawImage = [[UIImageView alloc] initWithImage:nil]; drawImage.frame = self.view.frame; [self.view addSubview:drawImage]; UIGraphicsBeginImageCont...

Mac OpenGL : No sound volume overlay in fullscreen

I have an OpenGL-based app that can run windowed or fullscreen in OS X 10.5. While in windowed mode, pressing the volume keys in the keyboard changes the volume setting (mute/unmute for example) and the OSX-drawn speaker icon overlay is drawn, as it happens with every other application. However, in full screen mode, pressing the keys d...

How to convert ASCII character to CGKeyCode?

I need a function that, given a character, returns the CGKeyCode associated with the position of that character on the current keyboard layout. E.g., given "b", it should return kVK_ANSI_B if using U.S. QWERTY, or 45 if using Dvorak. The Win32 API has the function VkKeyScan() for this purpose; X11 has the function XStringToKeySym(). Is t...

iPhone Quartz. How do I create a matte using a path rather then a bitmap?

In the visualization app I'm writing I want to shape a graphic using a matte created with a path. The graphic is a horizontal rectangular strip with various shapes drawn within. Atop this rectangular strip I want to draw an ellipse to act as a matte that shapes the rectangular strip to make it appear to drawn within the ellipse. How do I...

Drawing a PNG Image Into a Graphics Context for Blending Mode Manipulation

I need to draw a series of PNGs into a CG context so I can blend them together: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetBlendMode (context, kCGBlendModeOverlay); Currently I have my app working based on just drawing each image as a UIImageView and adding them as a subview to the view file via: [self addSubview...

Blending Three Images into Graphics Context Using Alpha Blend Mode kBlendModeOverlay

Does kCGBlendModeOverlay not work exactly like Photoshop's Overlay blending mode? I'm trying to overlay three images into a graphic context via: [uiimageGreen drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0]; [uiimageRed drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0]; [uiimageBlue drawAtPoin...

How to update a section of an NSView without redrawing the whole view.

I have a NSView where I draw thousands of NSBezierPaths. I would like to highlight (change fill color) the a selected one on mousemoved event. At the moment I use in mouseMoved function the following command: [self setsetNeedsDisplay:YES]; that force a call to drawRect to redraw every path. I would like to redraw only the selecte...

Quartz display services replacement for deprecated functions?

The Quartz display services reference manual lists several functions as deprecated, (for example CGDisplayCurrentMode), but doesn't mention what the replacement function is. What should I be using to find information about the current video mode? Is there a way to find out this kind of information? The reference manual on the apple de...

CGEventPost - possible bug when simulating keyboard events?

I have a very simple chunk of code that is designed to simulate keyboard events. The simple example below should type "Cz" - the shift key goes down, the c key goes down, c comes up and shift comes up. Then the z key goes down and up. It seems that sometimes the order gets muddled though. When I create a timer to call this routine ev...

CGContextSetLineWidth(context, 1) - the width is almost alwayas at least 2 pixels instead 1

With CGContextSetLineWidth(context, 1) the width is almost alwayas at least 2 pixels instead 1 QQCandleStickLayer.m -(id)init { self = [super init]; if(self != nil) { self.delegate = self; self.opaque = NO; } return self; } - (void)drawLayer:(CALayer*)layer inContext:(CGContextR...

How to delete NSBezierPath

H, I have an NSBezierPath that I created and I called -stroke on it. How do I remove/delete it from the view without deallocating the object. Thanks - Rebecca ...

Drawing a text along a path in QuartzCore

Say I have an array of points that form a line and a text. How can I go about drawing the text along this line in - (void)drawRect:(CGRect)rect of a UIView? I am able to draw the path without a problem. Is there a standard method that I overlooked or a framework that would allow me to draw the text along that path? Ideally I woul...

Image drawing on PDF fails to draw image with transformation and outputs wrong.

Hello guys, I've a problem with drawing images on PDF. I do apply scaling, rotation, move, etc. to an image and draws that image on the PDF. But drawing is not outputting correctly. When I do rotate image, it just scales and doesn't rotate. Here, I explain in more detail: I place an image on UIWebView to make fake effect of image exact...

How do I use CGEventKeyboardSetUnicodeString with multiple characters?

I'm trying to use event taps to create an OS X program that will listen for Yiddish typed in transliteration and post the result in Hebrew characters. I made a very short program to test one things I'd have to do: http://pastie.org/791398 As is, the program successfully replaces every typed 'q' with 'w': if(inputString[0] == 'q') { in...

PDF Making with Rotated Image for iPhone

I'm having problems with drawing rotated images on PDF, my output is worse. My case is, we don't know have any fixed co-ordinates. X,Y, rotation, etc. depends on ImageView itself. I select the ImageView and rotate it through Sliders. Check on ZOSH application. I need to implement functionalities like that app. I want to make PDF by add...

setNeedsDisplayInRect redrawing entire view when using CATiledLayer

Hi all, this is my first time posting so please excuse any lapses in stackoverflow etiquette. I haven't found any example code or any questions that address the problem I'm having, so hopefully someone can shed some light on this. I'm using Quartz and I have a CATiledLayer on which I have drawn several boxes you can click on. When y...

How can I draw rotated text without being limited to the MacRoman character set?

Hey folks, My blog has been mentioned here before as an answer to questions. I can't link to one of them, because this form claims I'm a spammer. Sigh. Anyway, now I want to write the definitive blog post on drawing rotated text, so it can also be used for answers here (heh). Here is my first try: http://www.platinumball.net/blog/2009/...