catiledlayer

Render large CATiledLayer into smaller area

别等时光非礼了梦想. 提交于 2020-01-02 23:04:24
问题 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? 回答1: [First

iPhone: CATiledLayer/UIScrollView wont scroll after zooming and only zooms to anchor point

ε祈祈猫儿з 提交于 2019-12-25 03:03:00
问题 Here is the problem... I am using CA Tiled Layer to display a large jpg. The view loads okay, and when I go to scroll around, it works fine. However, as soon as I zoom in or out once, it scrolls to the top left (to the anchor point) and will not scroll at all. The zooming works fine, but I just cannot scroll. Here is my code: #import <QuartzCore/QuartzCore.h> #import "PracticeViewController.h" @implementation practiceViewController //@synthesize image; - (void)viewDidLoad { NSString *path = [

ios5: drawRect called twice in CATiledLayer for the same Rect

假如想象 提交于 2019-12-23 03:03:54
问题 I have a problem with a CATiledLayer. It is working perfect in on iOS 4, but has problems on iOS 5. My Problem ist that drawRect is called twice for the same rect from two different threads at the same time. Since I load images in this call, it causes the view to load very slow. 2011-10-18 14:07:18.802 APP[12436:19003] drawRect:{{0, 400}, {368, 400}} (view:<TiledScrollColumn: 0x91bc880; frame = (0 1600; 368 5400); userInteractionEnabled = NO; layer = <CATiledLayer: 0x919c1b0>>) 2011-10-18 14

How do I keep a CALayer, sublayer of a CATiledLayer, from changing it's scale after a zoom?

自闭症网瘾萝莉.ら 提交于 2019-12-21 19:52:31
问题 I have a CATiledLayer that is used to display a PDF page (this CATiledLayer is the layer type of my UIView which is a subview of a UIScrollView). I want to add overlay markers on this page. So I add a sublayer to my CATiledLayer. This sublayer again hosts the different marker's layers and acts as a grouping layer. So graphically, I have: (keep in mind that I have multiple markers which are CALayers also, this is ascii art after all) pdf page (CATiledLayer) ---------------------- | CALayer | |

Using NSString's drawAtPoint method in place of CGContextShowGlyphsAtPoint problems

倾然丶 夕夏残阳落幕 提交于 2019-12-21 08:01:27
问题 In my app I'm trying to render text along a path; this is fine for most characters but not for Japanese (or anything non mac-Roman). I've been advised to use [NSString drawAtPoint] which displays the correct characters in my CATiledLayer; however, they dissapear after approximately 5 seconds. In this time I can zoom the layer and they scale properly, but they don't seem to get committed to the CATiledLayer like the rest of the text usually is. Before I render, I check the string and decide

Using NSString's drawAtPoint method in place of CGContextShowGlyphsAtPoint problems

夙愿已清 提交于 2019-12-21 08:01:02
问题 In my app I'm trying to render text along a path; this is fine for most characters but not for Japanese (or anything non mac-Roman). I've been advised to use [NSString drawAtPoint] which displays the correct characters in my CATiledLayer; however, they dissapear after approximately 5 seconds. In this time I can zoom the layer and they scale properly, but they don't seem to get committed to the CATiledLayer like the rest of the text usually is. Before I render, I check the string and decide

Unwanted scrolling when animating zoomScale in UIScrollView

此生再无相见时 提交于 2019-12-18 15:55:25
问题 Executive Summary: At times UIScrollView makes an unwanted change to the value of contentOffset , thus causing the app to display the wrong location in the document being viewed. The unwanted change happens in conjunction to an animated change to the scroll view's zoomScale . The Details: I'm having trouble when zooming out with CATiledLayer in a UIScrollView . The CATiledLayer holds a pdf, and when contentOffset is within a certain range, when I zoom out, the contentOffset is changed (that's

CATiledLayer in iPad retina simulator yields poor performance

六眼飞鱼酱① 提交于 2019-12-18 10:12:13
问题 I'm hoping maybe this is just an issue with the simulator but of course it has me worried since I have already submitted my retina capable apps and there's no way to test it until the 16th. I have implemented a CATiledLayer in my app to view very large maps. The tiles for the map are coming from the internet, however they also get cached, so, typically, they are actually being loaded directly from the device. On iPad 1 and iPad2 it works beautifully. You can only barely notice the tiles being

SIGABRT on NSDictionary objectAtIndex: unrecognized selector

人盡茶涼 提交于 2019-12-13 07:26:06
问题 I'm having a weird error here. I have an array named __ImageData: static NSArray *__ImageData = nil; NSString *path = [[NSBundle mainBundle] pathForResource:@"ImageData" ofType:@"plist"]; NSData *plistData = [NSData dataWithContentsOfFile:path]; NSString *error; NSPropertyListFormat format; _ImageData = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; When I NSLog out the content of the array, I get

CALayer and view disappeared

孤人 提交于 2019-12-11 02:36:39
问题 I have a large image managed with CATiledLayer (like the Large Image Downsizing iOS sample code). I had a drawing view (UIView overrided with drawing methods) on it but when I zoom a lot, I get the following message and my view disappeared.. -[<CALayer: 0xb253aa0> display]: Ignoring bogus layer size (25504.578125, 15940.361328) Is there a way to avoid this ? 回答1: Sounds like the levelsOfDetail and levelsOfDetailBias you are setting are allowing for more zoom than the tiled layer should allow