You can create them from several different sources, including files and Quartz image objects. Objects of this class represent images in the UIKit framework. The UIKit framework has three classes and one protocol that are related to images in some way: UIImage The UIKit framework as well as the lower-level system frameworks of iOS give you a wide range of possibilities for creating, accessing, drawing, writing, and manipulating images. Call the UIImageJPEGRepresentation or UIImagePNGRepresentation function to get an NSData object, and use that object’s methods to save the data to a file. You can do this using the UIKit functions or Core Graphics functions described in Creating New Images Using Bitmap Graphics Contexts.Ĭreate a UIImage object from the original image data. Save some bitmap data into an image object Load and draw the image using the UIImage class. You can still layer other views on top of the image view to draw additional controls or content.ĭisplay an image as an adornment for part of a view This option assumes that your view’s only content is an image. Use the UIImageView class to display the image. Table C-1 lists some of the usage scenarios and the recommended options for handling them.ĭisplay an image as the content of a view Whenever possible, though, it is recommended that you use the classes of UIKit for representing images in your code. How you determine which classes and functions to use to draw images depends on how you intend to use them. In addition, iOS provides support for loading and displaying images using both the UIKit and Core Graphics frameworks. Updating Your Image Resource Files discusses adjustments that make your image files compatible with high-resolution screens. You can find full descriptions of these bundled image files in Advanced App Tricks and App-Related Resources in App Programming Guide for iOS. You can have launch images and icons that are specific to device type (iPad versus iPhone and iPod touch) and that are optimized for high-resolution displays. Many images used by apps, including launch images and app icons, are stored as files in the app’s main bundle. They can be a key differentiating factor for apps. For both functional and aesthetic reasons, images are a pervasive element of app user interfaces.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |