catiledlayer

UIScrollView w/ Large CATiledLayer + Overlay that renders fast

浪尽此生 提交于 2019-12-10 16:15:15
问题 I've been working on something for weeks now (iOS) and I can't seem to figure out an acceptable solution. Requirements Display a 10000x10000 pixel background image Zooming and scrolling responsive Overlay on top that has custom drawing Elements in overlay are interactive (tapping and highlighting elements, etc) and pieces can be turned on or off. iOS 4.0 Think of it as a geographic map of a fictional town, with a crazy system of roads, lines, areas and buildings drawn on top. A mixture of

How to draw parts of a UIView as it becomes visible inside UICollectionView?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 14:44:59
问题 On Android I have item views with potentially large widths on a horizontal scrolling list. The view loads and draws chunks "images" as parts of the view become visible on the list. This is an optimization to avoid drawing all images at once as it would be wasteful and slow. The content drawn is essentially an audio waveform. Do to the ways things need to work I can't split the chunks as individual view items on a list. This strategy works perfect because of how android drawing architecture

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

自作多情 提交于 2019-12-08 09:00:01
问题 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 zooming occuring. So far, I got this code: (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { /* retrieve the transformation matrix from the

Why won't my CATiledLayer scroll in a UIScrollView after zooming?

久未见 提交于 2019-12-08 08:16:51
问题 I'm currently having the following problem with CATiledLayer: when the view first loads, the scrolling works perfectly, but then when you zoom once, the view snaps to the anchor point (top left corner) and it can no longer scroll at all. The zooming works in that it will zoom in and out, but it will only zoom to the top left corner. My code is as follows: #import <QuartzCore/QuartzCore.h> #import "PracticeViewController.h" @implementation practiceViewController //@synthesize image; - (void

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

三世轮回 提交于 2019-12-07 11:55:31
问题 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(CATiledLayerPrivate) canDrawRect:levelOfDetail:] 3 tiled_layer_render 4 CAImageProviderThread 5 CAImageProviderBackgroundThread 6 CA::DispatchGroup::thread 7 thread_fun 8

Why won't my CATiledLayer scroll in a UIScrollView after zooming?

落爺英雄遲暮 提交于 2019-12-06 22:46:25
I'm currently having the following problem with CATiledLayer: when the view first loads, the scrolling works perfectly, but then when you zoom once, the view snaps to the anchor point (top left corner) and it can no longer scroll at all. The zooming works in that it will zoom in and out, but it will only zoom to the top left corner. My code is as follows: #import <QuartzCore/QuartzCore.h> #import "PracticeViewController.h" @implementation practiceViewController //@synthesize image; - (void)viewDidLoad { NSString *path = [[NSBundle mainBundle] pathForResource:@"H-5" ofType:@"jpg"]; NSData *data

Render large CATiledLayer into smaller area

余生颓废 提交于 2019-12-06 21:52:31
I have a CATiledLayer of size 4096 x 4096 which I want to render into a PNG of size 1024 x 1024 this isnt doing it... -(NSData *)createPNGFormat { UIGraphicsBeginImageContext(CGSizeMake(1024, 1024)); tiledLayer.transform = CATransform3DMakeScale(0.25, 0.25, 1.0); [tiledLayer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return UIImagePNGRepresentation(image); } Any ideas on how to do this? [First Hack] Brute Force , Render tile by tile. This works (slowly) -(UIImage *)renderTileX:(NSInteger)xpos tileY:

Present and zoom large images on iOS without CATiledLayer

别说谁变了你拦得住时间么 提交于 2019-12-06 15:45:31
问题 I'd like to present and allow the user to zoom large images on the iPhone and iPad in much the same way that the Photos app works. I realize CATiledLayer is the goto class for this, but the aesthetic it uses won't work for my application. It renders tiles one after another, while the Photos app renders the whole screen at once (and shows a pixellated version during and after a zoom until the app can catch up). I could certainly implement a view which renders the image in the background after

How do I remove those rotation artefacts from my CATiledLayer?

雨燕双飞 提交于 2019-12-06 00:28:52
问题 I have a CATiledLayer into which I render content in the following method - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx I used the QuartzDemo code to draw a pattern. This works very well until I apply a rotation transform to the layer's parentLayer (a UIView): rotated: These zigzag artefacts become worse when I start drawing lines and texts into the CATiledLayer. I applied the transform as follows (I also tried using an affine transform on the view itself): self.containerView

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

≡放荡痞女 提交于 2019-12-05 12:29:13
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(CATiledLayerPrivate) canDrawRect:levelOfDetail:] 3 tiled_layer_render 4 CAImageProviderThread 5 CAImageProviderBackgroundThread 6 CA::DispatchGroup::thread 7 thread_fun 8 _pthread_start Now, I do want to release that certain instance of MyViewController because I don't need it