catiledlayer

Partial pdf page rendering on CATiledLayer

I'm using CATiledLayer to render a heavy pdf page inside a UIScrollView that is used to handle zooming and spanning.. The method below is called every time a Tile need to be drawn and I regret that I have to paint the whole pdf every time. I hope that behind the scene the CATiledLayer only render the part that it needs but nothing is l...

Convert CGPoint between iPhone & CA planes

I have a UIView subclass that I'm drawing a PDF onto (using a CATiledLayer). I also need to draw on a specific region of that PDF, however the coordinate plane of the CATiledLayer when using CG to draw is way screwy. See image: I have a point (200,200), that I need to convert to the CATiledLayer's coordinate system, which is the 2nd ...

Generating dynamic tiles for CATiledLayer

I've seen the WDC2010 Session 104 for using scrollviews and CATiledLayers, which is all pretty cool. But I'm not sure about the generation of the tile images. The example had the frog tile pictures already created. But if I have a photo app where I am taking my own photos, I will need to create the tiles myself and I'm not sure of the be...

CATiledLayer drawLayer:inContext: crashing when the view is deallocated while the image to draw is being retrieved

My app crashes when my ViewController gets deallocated while my CATiledLayer is retrieving the image to draw in a background thread. I get a message -[MyViewController respondsToSelector:]: message sent to deallocated instance 0x8f58e00 and the debugger shows 0 ___forwarding___ 1 __forwarding_prep_0__ 2 -[CATiledLayer(CATiledLayerPri...

Problem with UIScrollView and CATiledLayer

Hello ! I'm working on the example code named PhotoScroller (an Apple's example of WWDC 2010). There is an UIScrollView which return a custom UIView when zooming - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {     return imageView; } The layer of this imageView is a CATiledLayer. My problem is for each zoom t...

fuzzy pixel straddling when drawing in a CATiledLayer on iPhone 4

Hi, I'm drawing a line in a CATiledLayer using the following code: - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { CGContextMoveToPoint(ctx, 130, 100.5); CGContextAddLineToPoint(ctx, 160, 100.5); CGContextSetRGBStrokeColor(ctx, 1, 0, 0, 1); CGContextSetRGBFillColor(ctx, 1, 0, 0, 1); CGContextDrawPath...

How to draw on a non-transformed context while zoomed in a CATiledLayer?

I'm using a CATiledLayer for the visualisation of data. By default the drawLayer function gets a transposed and scaled context, which allow the drawing code to be agnostic of the zoom-level and the tile that's being requested. However, I would like to use the zoom functionality to change the horizontal range of the data, without actual z...

CATiledLayer drawInContext called after associated view is gone

I ran into an interesting iOS problem today involving a CATiledLayer. This only happend on the device - not in the simulator. My view draws in its CALayer via the drawLayer: inContext: delegate callback. This layer has a CATiledLayer-derived sublayer, which does its own drawing in an overridden drawInContext: method. Both layers are ...