Questions tagged [cglayer]

90 questions
57
votes
1 answer

What's the difference and compatibility of CGLayer and CALayer?

I'm confusing CGLayer and CALayer. They look similar, so why are there separate implementations? What's the difference between, and compatibility of, CGLayer and CALayer?
eonil
  • 83,476
  • 81
  • 317
  • 516
21
votes
4 answers

AVPlayerLayer not bounds to UIView frame

I'm trying to add AVPlayerLayer to UIView self.player = AVPlayer(URL: NSURL(fileURLWithPath: path!)) self.playerLayer = AVPlayerLayer(player: player); self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; …
Jornia Kabakum
  • 443
  • 8
  • 15
19
votes
2 answers

iOS: How do I support Retina Display with CGLayer?

I'm drawing a graph on a CALayer in its delegate method drawLayer:inContext:. Now I want to support Retina Display, as the graph looks blurry on the latest devices. For the parts that I draw directly on the graphics context passed by the CALayer, I…
Taka
  • 1,334
  • 17
  • 24
10
votes
1 answer

How should QuartzCore.framework imported in Swift?

I need QuartzCore.framework to add borderColor to a textfield, how?
János
  • 32,867
  • 38
  • 193
  • 353
9
votes
2 answers

On iOS, what is the fastest way to cache a drawn screen image and display it?

Instead of letting drawRect redraw thousands of point every time, I think there are several ways to "cache the image on screen" and any additional drawing, we will add to that image, and just show that image when it is time to drawRect: Use…
Jeremy L
  • 3,770
  • 6
  • 41
  • 62
8
votes
1 answer

OpenGL 3.2 context on a Carbon window (OS Lion, Mono)

I'm trying to add modern OS X support to OpenTK framework. Mac OS Lion supports OpenGL 3.2 Core context. I can successfully obtain it by using CGL. However, I can't find a straight way to bind the context to a Carbon window. Previous OpenTK…
kvark
  • 5,291
  • 2
  • 24
  • 33
6
votes
1 answer

iPhone - encoding and decoding a NSValue

So I read here on SO that I can encode a CGLayerRef to a NSValue using NSValue *myCopy = [[NSValue alloc] initWithBytes:&myLayer objCType:@encode(CGLayerRef)]; but how do I recreate the CGLayerRef from myCopy? thanks
Duck
  • 34,902
  • 47
  • 248
  • 470
6
votes
2 answers

Change UIButton BG color on highlighted, but preserve layer corner radius?

I’m changing the background colour of a UIButton via this category method, using a 1px by 1px image: - (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state { UIGraphicsBeginImageContextWithOptions(CGSizeMake(1, 1),…
Luke
  • 9,512
  • 15
  • 82
  • 146
6
votes
2 answers

clipsToBounds and masksToBounds in grouped UITableViewCell

I'm trying to get my UITextView's corners to be masked by the rounded corners of the grouped UITableViewCell that contains it. Here's a screenshot of the cell as it currently stands Here's some of the code I'm using to try to prevent the corners…
conorgriffin
  • 4,282
  • 7
  • 51
  • 88
5
votes
1 answer

CGL vs AGL vs OpenGL vs NSOpenGL vs CoreAnimation(CALayer)

I am trying to understand few things on Mac related to OpenGL framework integration in the form of layers. Well basically when I want to understand 3D technologies present in OS X and which layer is OpenGL's actual implentation layer. From reading…
RLT
  • 4,219
  • 4
  • 37
  • 91
5
votes
2 answers

Difference between CGLayer, CALayer and CGContext

What is the difference between CGLayer, CALayer and CGContext?
rishu1992
  • 1,414
  • 3
  • 14
  • 33
5
votes
3 answers

"CGLayer no longer recommended"; Is this the general consensus?

I've written an iOS app in which I'm using CGLayer quite successfully. While researching ways to squeeze a bit more performance out of this app, I came across this blog post: http://iosptl.com/posts/cglayer-no-longer-recommended/ in which the author…
Manny
  • 967
  • 1
  • 6
  • 17
5
votes
1 answer

objective c - UINavigationBar with rounded corners

I want to make my navigation bar a one with rounded corners (the top left and right) I found this code that make it happen: CALayer *capa = [self.navigationController navigationBar].layer; [capa setShadowColor: [[UIColor blackColor]…
Eyal
  • 10,777
  • 18
  • 78
  • 130
4
votes
2 answers

How to draw to multiple CGLayers at the same time?

I'd like to draw objects to two separate CGLayers from within the same for loop, but am unsure how to do this. For example, I'd like to draw three orange circles behind three blue circles, with the orange circles in one layer, and the blue circles…
bob
  • 605
  • 6
  • 12
4
votes
1 answer

Slow performance with CGlayer Drawing

I am using CGlayers for drawing, as the documentation says, it's more efficient way to render drawing on canvas. I basically draw into CGlayers and the draw the layer into the graphics context using CGContextDrawLayerInRect Here is my drawRect…
Ranjit
  • 4,576
  • 11
  • 62
  • 121
1
2 3 4 5 6