quartz-core

Deprecated ColorSync Manager Functions

喜你入骨 提交于 2019-12-11 10:44:06
问题 The ColorSync Manager functions was deprecated. Where to find the solution to deal with about icc profile. Thanks 回答1: All ColorSync Manager function are deprecated since Mac OS X 10.6 (see https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/ColorSync_Manager/Reference/reference.html). As far as I know: All ColorSync functions are still available up to OS X 10.9. The reason is probably that many applications depend on this functionality. There is no other Apple

How to fill CircularProgressBar with multiple colors

无人久伴 提交于 2019-12-11 05:30:59
问题 I have implement CircularProgress Bar using this tutorial Link But I want to fill this CircularProgress Bar with two or three color not with only one color. How I can do this please help me out. Thanks In Advance 来源: https://stackoverflow.com/questions/16030464/how-to-fill-circularprogressbar-with-multiple-colors

Exported PNG image looks scrambled when generated by CGWindowListCreateImage/PNGCanvas

一曲冷凌霜 提交于 2019-12-11 04:15:31
问题 I've got this Python code: import Quartz.CoreGraphics as cg region = cg.CGRectMake(0, 0, 100, 100) # You can also use cg.CGRectInfinite for the full screen. image = cg.CGWindowListCreateImage(region, cg.kCGWindowListOptionOnScreenOnly, cg.kCGNullWindowID, cg.kCGWindowImageDefault) prov = cg.CGImageGetDataProvider(image) img_data = cg.CGDataProviderCopyData(prov) img_width, img_height = cg.CGImageGetWidth(image), cg.CGImageGetHeight(image) from pngcanvas import PNGCanvas import struct canvas =

Stroke a CGContext path using an image in CoreGraphics

风格不统一 提交于 2019-12-10 00:28:34
问题 Im trying to draw line by stroking an image to have brush like effect via CoreGraphics framework. I followed this post and this post and tried to draw from the touchesMoved method and the code sample'll be of the form UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInView:self.view]; UIImage *texture = [UIImage imageNamed:@"texture.png"]; CGPoint vector = CGPointMake(currentPoint.x - lastPoint.x, currentPoint.y - lastPoint.y); NSLog(@" vector %@",

Recognizing touch events only inside the masked view

拥有回忆 提交于 2019-12-09 23:25:32
问题 I am creating this structured through masks: Each hexagon should be clickable. This is the code I used: // To create one masked hexagun let hex = UIImage(named: "hexum") let mask = CALayer() mask.contents = hexum!.CGImage mask.frame = CGRectMake(0, 0, hex!.size.width, hex!.size.height) let img = UIImageView(image: UIImage(named: "img")) img.layer.mask = mask img.layer.masksToBounds = true // Gesture Recognizer let singleTap = UITapGestureRecognizer(target: self, action: "tapDetected")

Glass effects UIView

孤街浪徒 提交于 2019-12-09 21:34:38
问题 I would like to know how it is possible to add a glass effect on a UIView I would like something like this effects on the gray translucent view you can see here : Thanks 回答1: There's nothing like glass effect in UIView .All you can do is set the opacity of the view between 0 and 1.Also the view shown above has fine set of images which makes it seem like your "Glass Effect". Well If you what your UIView to be "shiny and elegant" , you can do it in two ways :- 1>You can simply have effects in

CIImage drawing EXC_BAD_ACCESS

六眼飞鱼酱① 提交于 2019-12-08 02:34:08
问题 So, I have a CIImage that I'm attempting to draw in an NSView 's -drawRect method. This is the line of code that I call to draw the image: [outputCoreImage drawInRect: [self bounds] fromRect: originalBounds operation: NSCompositeSourceOver fraction: 1]; outputCoreImage , originalBounds , and [self bounds] are all non- nil , and indeed are their respective expected values. On Lion (OS X 10.7), this worked fine, however on Mountain Lion (OS X 10.8) I receive an EXC_BAD_ACCESS on this line. If I

CALayer as SubLayer Not Visible

你。 提交于 2019-12-07 05:25:55
问题 I am trying to built an animated circle which would be drawn clockwise until it becomes complete circle as illustrated in iPhone Core Animation - Drawing a Circle Problem is that CALayer object is not added or build. I tested and saw that it is not accessing my drawInContext:CGContextRef and animatingArc methods. What so far I have done is: In AnimateArc.h @interface AnimateArc : CALayer { CAShapeLayer *circle; } -(void) animatingArc; @end In AnimateArc.m -(void) drawInContext:(CGContextRef

CIImage drawing EXC_BAD_ACCESS

北城以北 提交于 2019-12-06 13:42:45
So, I have a CIImage that I'm attempting to draw in an NSView 's -drawRect method. This is the line of code that I call to draw the image: [outputCoreImage drawInRect: [self bounds] fromRect: originalBounds operation: NSCompositeSourceOver fraction: 1]; outputCoreImage , originalBounds , and [self bounds] are all non- nil , and indeed are their respective expected values. On Lion (OS X 10.7), this worked fine, however on Mountain Lion (OS X 10.8) I receive an EXC_BAD_ACCESS on this line. If I walk up the stack, I find that the internal function call that breaks is on CGLGetPixelFormat . frame

kCGTextStroke's Fill and Stroke aren't positioned correctly

让人想犯罪 __ 提交于 2019-12-06 09:23:06
So I'm using the code below to apply a stroke (and fill) to text in a UILabel , and it's coming out like the image below. The stroke is heavier on one side than the other (look at the top of the letters compared to the bottom, and the right compared to the left. The period at the end makes it very noticeable, too, looks like a googly eye). I've not got any shadowing turned on at all, so I don't think it's the shadow interfering with the stroke. What could be causing this? - (void) drawTextInRect: (CGRect) rect { CGContextRef c = UIGraphicsGetCurrentContext(); CGContextSetTextDrawingMode(c,