Quartz is graphic framework used on Mac OS X. It forms a graphic layer. Term Quartz is used to represent Quartz 2D and Quartz Compositor. Quartz graphic is a 2D renderer in Core Graphics.
Questions tagged [quartz-graphics]
1214 questions
21
votes
6 answers
Adding glow effect to UIButton - iOS
I have an UIButton which is a logo. This logo button will glow on forever but will stop glowing on touch.It is like a glowing animation.
Is there any suggestions?
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CABasicAnimation",…

Siddharthan Asokan
- 4,321
- 11
- 44
- 80
21
votes
3 answers
How to create a UIImage from the current graphics context?
I'd like to create a UIImage object from the current graphics context. More specifically, my use case is a view that the user can draw lines on. They may draw incrementally. After they are done, I'd like to create a UIImage to represent their…

figelwump
- 807
- 1
- 7
- 16
21
votes
7 answers
Drawing rotated text with NSString drawInRect
I found this answer on how to draw rotated text with NSString drawInRect:, but I'm not sure how it works since it only sort of works for me: https://discussions.apple.com/thread/1779814?start=0&tstart=0
My code looks like:
…

Crystal
- 28,460
- 62
- 219
- 393
20
votes
4 answers
How to add a CALayer to an NSView on Mac OS X
I'm trying to learn how to use and implement CALayer in a Mac Objective-C application, but I can't seem to probably do the most basic thing - add a new layer and set its background colour/frame size. Can anyone see what is wrong with my…

GravityScore
- 385
- 1
- 3
- 13
20
votes
2 answers
(Scale) Zoom into a UIView at a point
Something I don't understand about transformations. I want to zoom in to say the top right corner of a UIView (the main view). I use CGAffineTransformScale and have tried both setting the center/anchorPoint as well as…

akaru
- 6,299
- 9
- 63
- 102
20
votes
3 answers
Uiimage from UIView: higher than on-screen resolution?
I've got a UIView which I'm rendering to a UIImage via the typical UIGraphicsBeginImageContextWithOptions method, using a scale of 2.0 so the image output will always be the "retina display" version of what would show up onscreen, regardless of the…

DanM
- 7,037
- 11
- 51
- 86
20
votes
2 answers
Performing a double click using CGEventCreateMouseEvent()
I'm using the following code to simulate a click of the mouse:
void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint point)
{
CGEventRef theEvent = CGEventCreateMouseEvent(NULL, type, point, button);
CGEventSetType(theEvent,…

Uri
- 1,275
- 6
- 17
- 26
19
votes
2 answers
iOS: How do you measure the width and height of a string using Quartz?
Before I ask my questions, this is from Apple's documentation re: how to determine the width of a string using Quartz:
If text measurements are important to your application, it is possible
to calculate them using Quartz 2D functions. However,…

Hunter D
- 673
- 2
- 8
- 13
19
votes
1 answer
drawInRect: losing Quality of Image resolution
I am trying to erase image using following code
CGColorRef strokeColor = [UIColor whiteColor].CGColor;
UIGraphicsBeginImageContext(imgForeground.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[imgForeground.image…

Shashank Kulshrestha
- 1,556
- 17
- 31
18
votes
2 answers
UIView with rounded corners: how to clip subviews correctly?
I created a subclass of UIView that overrides drawRect: and uses AddArcToPoint() to draw rounded corners. (I don't want to use the layer's corner radius property because I need to define which corners have to be rounded.)
The problem I cannot get…

Krumelur
- 32,180
- 27
- 124
- 263
18
votes
4 answers
CoreGraphics Quartz drawing shadow on transparent alpha path
Searching the web for about 4 hours not getting an answer so:
How to draw a shadow on a path which has transparency?
- (void)drawRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(c, 2);
…
user207616
18
votes
2 answers
Activate a window using its Window ID
How would I programmatically activate i.e move-to-front-and-focus a window on macOS (not belonging to my app) given its Window ID. My app would run with user granted Accessibility permissions etc.
Surprisingly, none of the functions described on the…

Himanshu P
- 9,586
- 6
- 37
- 46
18
votes
2 answers
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
Then…

Moduspwnens
- 525
- 1
- 5
- 9
18
votes
3 answers
Mac event tap just delays discarded events
I'm trying to write some code that discards all keyboard and mouse events when enabled on Mac OSX 10.6. My code runs as the root user. The approach I'm taking is to create an event tap that discards all events passed to it (while enabled). The event…

Thomi
- 11,647
- 13
- 72
- 110
18
votes
0 answers
Color Space options for CIContext
When creating a Core Image CIContext using the following:
contextWithCGLContext:pixelFormat:colorSpace:options:
You can specify a color space with a CGColorSpaceRef. However, the options dictionary that you can pass also allows you to set certain…

Cutterpillow
- 1,717
- 13
- 32