Quartz 2d Programming Guide


E-Book Content

Quartz 2D Programming Guide Graphics & Animation: 2D Drawing 2010-11-19 Apple Inc. © 2001, 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. The Apple logo is a trademark of Apple Inc. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Cocoa, ColorSync, eMac, Mac, Mac OS, Objective-C, Pages, Quartz, QuickTime, Spaces, Tiger, and Xcode are trademarks of Apple Inc., registered in the United States and other countries. Adobe, Acrobat, and PostScript are trademarks or registered trademarks of Adobe Systems Incorporated in the U.S. and/or other countries. Adobe, Acrobat, and PostScript are trademarks or registered trademarks of Adobe Systems Incorporated in the U.S. and/or other countries. Adobe, Acrobat, and PostScript are trademarks or registered trademarks of Adobe Systems Incorporated in the U.S. and/or other countries. Helvetica is a registered trademark of Heidelberger Druckmaschinen AG, available from Linotype Library GmbH. IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license. OpenGL is a registered trademark of Silicon Graphics, Inc. Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. Contents Introduction Introduction 15 Who Should Read This Document? 15 Organization of This Document 15 See Also 16 Chapter 1 Overview of Quartz 2D 19 The Page 19 Drawing Destinations: The Graphics Context 20 Quartz 2D Opaque Data Types 22 Graphics States 23 Quartz 2D Coordinate Systems 24 Memory Management: Object Ownership 26 Chapter 2 Graphics Contexts 29 Drawing to a View Graphics Context in iOS 29 Creating a Window Graphics Context in Mac OS X 29 Creating a PDF Graphics Context 31 Creating a Bitmap Graphics Context 35 Supported Pixel Formats 39 Anti-Aliasing 40 Obtaining a Graphics Context for Printing 41 Chapter 3 Paths 43 Path Creation and Path Painting 43 The Building Blocks 44 Points 45 Lines 45 Arcs 45 Curves 47 Closing a Subpath 48 Ellipses 49 Rectangles
You might also like

Parallel And Distributed Logic Programming
Authors: Bhattacharya A. , Konar A. , Mandal A.    156    0


Distributed Computing: Principles, Algorithms, And Systems
Authors: Ajay D. Kshemkalyani , Mukesh Singhal    66    0


Invitation To Fixed-parameter Algorithms
Authors: Rolf Niedermeier    84    0


The Curve Shortening Problem
Authors: Kai-Seng Chou , Xi-Ping Zhu    119    0


Introduction To Information Theory And Data Compression
Authors: D.C. Hankerson , Greg A. Harris , Peter D. Johnson Jr.    121    0


Digital Image Processing (preview)
Authors: Rafael C. Gonzalez , Richard E. Woods    118    0


Introduction To Complexity Theory, Lecture Notes
Authors: Goldreich O.    105    0


Introduction To Programming With Fortran 77, 90, 95, 2003
Authors: Chivers , Sleightholme.    127    0


Linear Programming: Foundations And Extensions
Authors: Robert Vanderbei    104    0


Beowulf Cluster Computing With Linux
Authors: William Gropp , Ewing Lusk , Thomas Sterling , Jon "maddog" Hall    124    0