Questions tagged [cglayer]
90 questions
0
votes
1 answer
Getting blur stroked while drawing in Cglayer
I am working with a drawing app where I draw inside CGlayers and then draw on grahics context, but I drawing is getting blurred.
Here is my code
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();//Get a reference…

Ranjit
- 4,576
- 11
- 62
- 121
0
votes
1 answer
Drawing a CGLayer outside the method drawRect: faster?
I'm not really sure, what am I asking...
...but if make layer composites in separate methods, and draw them to the view also outside of the drawRect: method... ...then could my app performance get raised?
I'm actually subclassed a puzzlePiece:UIView…

Geri Borbás
- 15,810
- 18
- 109
- 172
0
votes
1 answer
iOS Load CGImage into CGLayer and draw on top
I need to load an image into a CGLayer and draw some paths over it.
The below code doesn't quite work: it doesn't allow me to draw the paths over the image (there are gaps in the paths). Please see the below image. The black square is an image…

Simon
- 384
- 4
- 22
0
votes
3 answers
The antialias of rotated CGImage/CGlayer seems jaggy, UIImageView's is not
I need to mask a "texture" image with a rotated greyscale image.
I found out, that I have to do it with CGImages or CGlayers (if there is a simplier way using UIImageViews only, please let me know about it).
My problem is simple:
The antialias of…

Geri Borbás
- 15,810
- 18
- 109
- 172
0
votes
1 answer
iOS render image in context not working as expected in landscape orientation
The code below seems to work well to render an image from a view at retina resolution. The problem is it does not seem to work while my device is in landscape orientation. It returns an image rotated 90 degrees.
Do I need to add options for image…

OWolf
- 5,012
- 15
- 58
- 93
0
votes
1 answer
When to retain and release CGLayerRef?
I have a question similar to this one:
CGLayerRef in NSValue - when to call retain() or release()?
I am drawing 24 circles as radial gradients in a view. To speed it up I am drawing the gradient into a layer and then drawing the layer 24 times. …

Steve Ravet
- 56
- 1
- 5
0
votes
1 answer
CGLayerRelease crashes
I have a Cocoa app with ARC enabled. I am using OS 10.8 and Xcode 4.4. The app sporadically crashes upon calls to CGLayerRelease, dumping messages like the following to console:
error for object 0x10a2d2000: entry for pointer being freed from…

Ruben
- 1,950
- 1
- 12
- 13
0
votes
0 answers
How to store CGLayers in Drawing
I am working with CgLayers for drawing in iOS, Now I want to store these layers and retrieve it later, so I want to know what are the available options. I tried to use NSMutableDictionary, below is the code,
- (void)touchesEnded:(NSSet *)touches…

Ranjit
- 4,576
- 11
- 62
- 121
0
votes
2 answers
How to use CgLayer for optimal drawing
I have created a simple drawing project,the code works fine, but I want to cache the drawing into CGlayer, because I read that its more efficient way in drawing . I have read through the documents, but not able to understand it properly. So friends,…

Ranjit
- 4,576
- 11
- 62
- 121
0
votes
2 answers
iOS: How Can I Rotate A CGLayer?
I have been looking far and wide for the answer. I'm still coming up to speed on iOS dev, so I can definitely accept that I may be clooless here. However, the complete and utter lack of answers out there makes me wonder if there actually is an…

Chris Marshall
- 4,910
- 8
- 47
- 72
0
votes
2 answers
Create CGContext for CGLayer
I want to pre-render some graphics into CGLayer for fast drawing in future.
I found that CGLayerCreateWithContext requires a CGContext parameter. It can be easily found in drawRect: method. But I need to create a CGLayer outside of drawRect:.…

PDaria
- 457
- 10
- 21
0
votes
2 answers
Why CGlayerRef or CGcontextRef can't be saved in NSdata?
I saved CGlayerRef and CGcontextRef in NSdata, and when I get them to cover the current one,I find that only the poiners were saved but not the data.
For that reason, I can't make these CGlayerRef or CGcontextRef as a copy.(I did this all in…

dasheinz
- 1
- 2
0
votes
0 answers
Strange behavior of CGLayerCreateWithContext on iPad 2 vs on the New iPad?
In a Single View App, FooView is the main view. In FooView's drawRect, if I do
if (!self.layer1) {
CGContextRef context = UIGraphicsGetCurrentContext();
NSLog(@"current context is drawRect is %@", context);
self.layer1 =…

nonopolarity
- 146,324
- 131
- 460
- 740
0
votes
0 answers
On iOS, why do we have to create a layer using an existing Graphics Context?
Possible Duplicate:
On iOS, after we create a layer from context and get the layer's context, how do these contexts relate to each other?
On iOS, we could do a CGLayerCreateWithContext using the existing Graphics Context, and we would get a…

Jeremy L
- 3,770
- 6
- 41
- 62
-1
votes
1 answer
How to display a UIView when it overlaps another iOS?
I am trying to re-implement something similar to the Apple Watch Friend Picker. I have two UIViews, both with a corner radius of half their height so they appear as circles. How do I calculate where they overlap and only show that part. My UI is in…

Big_Mac
- 2,975
- 4
- 20
- 36