欢迎来到天天文库
浏览记录
ID:40057754
大小:116.44 KB
页数:10页
时间:2019-07-18
《Core Animation Cookbook》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、CoreAnimationCookbookContentsCoreAnimationCookbook4OrganizationofThisDocument4SeeAlso4Drawing5DrawingLayerContentWithApplicationKitClasses5Timing7UsingaSingleTimingFunctionForaKeyframeAnimation7DocumentRevisionHistory92008-03-11
2、Copyright©2008AppleInc.AllRightsReserved.2Li
3、stingsDrawing5Listing1DrawingintoalayerusingApplicationKitclasses5Timing7Listing1Usingasingletimingfunctionforakeyframeanimation72008-03-11
4、Copyright©2008AppleInc.AllRightsReserved.3CoreAnimationCookbookThisdocumentprovidesinstructionsandcodefragmentsthatdescribehowtoperfo
5、rmcommonCoreAnimationtasks.OrganizationofThisDocumentThisdocumenthasthefollowingchapters:●“Drawing”(page5)describesvariousdrawingtechniqueswhenworkingwithlayers.●“Timing”(page7)describesvarioustimingtechniqueswhenworkingwithanimations.SeeAlsoTheseprogrammingguidesdiscussso
6、meofthetechnologiesthatareusedbyCoreAnimation:●CoreAnimationProgrammingGuidedescribestheCoreAnimationtechnologyandshowshowtousetheCoreAnimationAPI.●Quartz2DProgrammingGuidedescribesthetwo-dimensionaldrawingengineusedtodrawthecontentofanCALayerinstance.●CoreImageProgramming
7、GuidedescribestheOSXimageprocessingtechnologyandshowshowtousetheCoreImageAPI.2008-03-11
8、Copyright©2008AppleInc.AllRightsReserved.4DrawingThischapterdiscussesdrawingissueswhenusingCoreAnimationandothertechnologies.DrawingLayerContentWithApplicationKitClassesCoreAnimationCAL
9、ayerclassdefinesadelegatemethod,drawLayer:inContext:,thatyoucanimplementanddrawyourlayercontentusingQuartz2Ddrawingfunctions.However,CocoadeveloperswhohavecompleteandworkingdrawingsolutionsbasedontheApplicationKitdrawingclassesmaywishtocontinueusingthatcode.Listing1showsan
10、implementationoftheCALayerdelegatemethoddrawLayer:inContext:thatcreatesanNSGraphicsContextfromtheCGContextRefpassedastheinContext:parameter.LayerdelegatescanusethistechniquetodisplaycontentcreatedusingNSBezierPath,NSColor,NSImageandotherApplicationKitclasses.Listing1Drawin
11、gintoalayerusingApplicationKitclasses-(void)drawLayer:(CALayer*)layerinContext:(CGContext
此文档下载收益归作者所有