Questions tagged [cglayer]

90 questions
1
vote
3 answers

iPhone: Crash While Drawing CGLayers Stored in Array

I'm trying to build a drawing app with redo and undo functionality. My idea is to draw lines in a layer in "touchMoved", then saving the layer in "touchEnded". I'm not shure that I am drawing to the layer correct, everything works fine though, until…
Oscar
  • 375
  • 3
  • 15
1
vote
2 answers

How to improve drawing quality of CGLayer

I use CoreGraphics for drawing circles in a custom SGCircleView. as I want the circles to be filled with a radial gradient when being touched, my appraoch is to draw one layer with the raw circle (SGCircleLayer) and then add another layer with the…
RTasche
  • 2,614
  • 1
  • 15
  • 19
1
vote
1 answer

Is CGLayer a good solution?

I want to add a bit of functionality to my App, and I think that using a CGLayer is the best way of doing it, but have never done any Quartz drawing before (other than some basic tutorials). My intention is to show a full view of an image that my…
Jools
  • 133
  • 1
  • 1
  • 5
1
vote
2 answers

How can I draw an image with many tiny modifications?

I am drawing many audio meters on a view and finding that drawRect can not keep up with the speed of the audio change. In practice only a very small part of the image changes at a time so I really only want to draw the incremental changes. I have…
Ant
  • 1,668
  • 2
  • 18
  • 35
1
vote
2 answers

Interpolation issue after renderInContext:UIGraphicsGetCurrentContext(), iOS

I have a few UIVies butted edge to edge. THe views completely cover the superView. Looks great in display, but when rendered the adjoining edges are visible, that is to sat a line appears between them. Since the views look perfect in display, I…
OWolf
  • 5,012
  • 15
  • 58
  • 93
1
vote
1 answer

how to add diagonal strokes to a UIView

how can i add an X looking red stroke to a UIImageView. i would like to add 2 diagonal red lines to a UIImageView, is there a way to do it programmatically using layers or masks? (not in drawRect)
David Ben Ari
  • 2,259
  • 3
  • 21
  • 40
1
vote
2 answers

Computing a UIImage to be saved to the photo album

I basically want to automatically create a tiled image from a bunch of source images, and then save that to the user's photo album. I'm not having any success drawing a bunch of small UIImage's into one big UIImage. What's the best way to accomplish…
Eli
  • 4,874
  • 6
  • 41
  • 50
1
vote
2 answers

undo redo issues with CGLayer

I am working with unod redo operations on CgLayer, I have tried some code, but not able to get it working, dont know , where I am getting wrong, below is my code, which i have written this is my drawRect function - (void)drawRect:(CGRect)rect { …
Ranjit
  • 4,576
  • 11
  • 62
  • 121
1
vote
0 answers

On iOS, how do we get a graphics context cached on the GPU?

And maybe the first question is: is it useful or possible to get a graphics context cached on the GPU: On iPad 1, 2, and the New iPad, PowerVR is used as the GPU, and does it use the RAM as graphics memory? If so, can it and does it help if we get…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
2 answers

Jaggy paths when blitting an offscreen CGLayer to the current context

In my current project I need to draw a complex background as a background for a few UITableView cells. Since the code for drawing this background is pretty long and CPU heavy when executed in the cell's drawRect: method, I decided to render it only…
polyclick
  • 2,704
  • 4
  • 32
  • 58
0
votes
0 answers

How to change position of AVPlayer when changing orientation to lanscape mode in Swift

When changing orientation to landscape, I try to adapt my programmatically created video player. Everything adapts normally through change of constraints, except for the player itself. He is not mobile. Probably, this is due to the fact that the…
0
votes
2 answers

How to remove UIView subviews w/out forcing a redraw?

This is somewhat of a hypothetical question, but I can imagine this situation coming up at some point in the future: Let's assume for a moment that I have a freakishly complicated hierarchy of UIViews that I'd need to render only once. Let's also…
David R.
  • 268
  • 4
  • 6
0
votes
1 answer

Draw CGImageRef & CGBitmapContextRef on CGL context?

I am looking for a way to draw a CGImageref and CGBitmapContextRef on CGL Context?
RLT
  • 4,219
  • 4
  • 37
  • 91
0
votes
1 answer

Taking snapshot of contents in CGL?

I want to create a image out of Core OpenGL context. I used following code but it creates a black image. So I guess I cannot use glReadPixles there? Any other suggestions please? int myDataLength = 480 * 480 * 4; // allocate array and read pixels…
RLT
  • 4,219
  • 4
  • 37
  • 91
0
votes
1 answer

CGLayerRef in NSValue - when to call retain() or release()?

I am caching some graphics onto CGLayers and then storing them in NSValue objects using @encode (so as to store them in an array). I just wanted to make sure that I handle the retain/release correctly... I cache the graphics and store them in the…
Stuart
  • 36,683
  • 19
  • 101
  • 139