quartz-2d

Create a table of contents from a pdf file

我的未来我决定 提交于 2019-12-17 10:36:22
问题 I'm using quartz to display pdf content, and I need to create a table of contents to navigate through the pdf. From reading Apple's documentation I think I am supposed to use CGPDFDocumentGetCatalog, but I can't find any examples on how to use this anywhere. Any ideas? Update: Still haven't found a solution for this. I tired Alex' solution but the output I get looks like this: 2011-07-27 09:16:19.359 LDS Scriptures App-iPad[624:707] key: Pages 2011-07-27 09:16:19.361 LDS Scriptures App-iPad

Create a table of contents from a pdf file

廉价感情. 提交于 2019-12-17 10:36:03
问题 I'm using quartz to display pdf content, and I need to create a table of contents to navigate through the pdf. From reading Apple's documentation I think I am supposed to use CGPDFDocumentGetCatalog, but I can't find any examples on how to use this anywhere. Any ideas? Update: Still haven't found a solution for this. I tired Alex' solution but the output I get looks like this: 2011-07-27 09:16:19.359 LDS Scriptures App-iPad[624:707] key: Pages 2011-07-27 09:16:19.361 LDS Scriptures App-iPad

How to map atan2() to degrees 0-360

早过忘川 提交于 2019-12-17 05:43:10
问题 atan2(y,x) has that discontinuity at 180° where it switches to -180°..0° going clockwise. How do I map the range of values to 0°..360°? here is my code: CGSize deltaPoint = CGSizeMake(endPoint.x - startPoint.x, endPoint.y - startPoint.y); float swipeBearing = atan2f(deltaPoint.height, deltaPoint.width); I'm calculating the direction of a swiping touch event given the startPoint and endPoint, both XY point structs. The code is for the iPhone but any language that supports atan2f() will do.

How to map atan2() to degrees 0-360

こ雲淡風輕ζ 提交于 2019-12-17 05:42:50
问题 atan2(y,x) has that discontinuity at 180° where it switches to -180°..0° going clockwise. How do I map the range of values to 0°..360°? here is my code: CGSize deltaPoint = CGSizeMake(endPoint.x - startPoint.x, endPoint.y - startPoint.y); float swipeBearing = atan2f(deltaPoint.height, deltaPoint.width); I'm calculating the direction of a swiping touch event given the startPoint and endPoint, both XY point structs. The code is for the iPhone but any language that supports atan2f() will do.

How to draw an animatable ruler with Quartz2D?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 03:57:17
问题 I'd like to draw the lines of a simple ruler with Quartz2D, just for practice. Since I have no idea about doing vector graphics programmatically on the iPhone, maybe someone can point me to a good tutorial to get started? 回答1: As Plamen points out, the Quartz 2D documentation is worth reading. Additionally, the course notes are available online (VoodooPad format) for my iPhone development course, where I devote an entire class to Quartz 2D drawing. The QuartzExamples sample application I

Can I programmatically add link annotation to PDFs?

给你一囗甜甜゛ 提交于 2019-12-13 18:15:06
问题 I am making an iPad app that uses UIWebView to display PDFs. I have a PDF that I would like to programmatically add links to. For simplicity, lets say there are 10 paragraphs. They are all numbered and have a few lines of text in them. I want to be able to somehow add a basic link to the PDF so that if paragraph 2 is touched, then my UIWebView can process the request that is associated with paragraph 2. I have no idea what the structure of the PDF is like on the inside. I have no clue how to

pdf images color space trouble ios

本小妞迷上赌 提交于 2019-12-12 20:42:58
问题 EDIT The pdf files I have been using apparently are on "indesign" format (whatever that means) and therefore have no colour profile, does anyone knows how can I add the profile myself if is possible at all? End of edit thanks in advance for any hand that any one can lend on this problem. First of all let me tell you that I am kind of new at developing for IOS, I am trying to make a pdf reader using quartz on xcode, everything works fine except for the rendering of the images, for some reason

iPhone Quartz2D render expanding circle

那年仲夏 提交于 2019-12-12 09:24:31
问题 I'm curious as to the 'proper' method for achieving the following functionality using Quarts2D: I want to have a view, and to be able to add a circle at any coordinate. As soon as I add the circle it should expand at a predefined rate; I'd also like to repeat this process and have a number if these expanding circles. Think Missile Command: Generally, if I was writing this in C++ using SDL or some other graphics library I would: Have a class to represent an 'growing circle' Have a vector/array

What this error is invalid context 0x0?

怎甘沉沦 提交于 2019-12-12 08:55:04
问题 I wrote the following code in ViewDidLoad // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -(void)viewDidLoad { [super viewDidLoad]; NSString *str = [NSString stringWithFormat:@"Veer"]; CGColorSpaceRef rgbColorspace = CGColorSpaceCreateDeviceRGB(); CGFloat values[4] = {55.0, 0.0, 0.0, 1.0}; CGColorRef glowColor = CGColorCreate(rgbColorspace, values); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetShadowWithColor( context,

How to assemble animation from an array of images with the highest FPS possible on iOS?

孤者浪人 提交于 2019-12-12 01:09:37
问题 I apologize in advance if this question sounds dumb. I have an array of images produced by another project, and I want to show them on the screen in sequence as fast as possible to assemble them to animation. How should I do this to achieve a frame rate at least higher than 30FPS? I'm new to iOS development and I'm not sure where to start with. Should I look into Core Animation or OpenGL or Quartz2D or something else? Can someone please point me a direction? Thanks a lot! Really appreciate