Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
|
A bitmap image. More...
#import <CPTImage.h>
Public Class Methods | |
Factory Methods | |
(nonnull instancetype) | + imageNamed: |
Initializes a CPTImage instance with the named image. More... | |
(nonnull instancetype) | + imageWithNativeImage: |
Initializes a CPTImage instance with the provided platform-native image. More... | |
(nonnull instancetype) | + imageWithContentsOfFile: |
Initializes a CPTImage instance with the contents of a file. More... | |
(nonnull instancetype) | + imageWithCGImage:scale: |
Creates and returns a new CPTImage instance initialized with the provided CGImageRef. More... | |
(nonnull instancetype) | + imageWithCGImage: |
Creates and returns a new CPTImage instance initialized with the provided CGImageRef and scale 1.0 . More... | |
(nonnull instancetype) | + imageForPNGFile: |
Creates and returns a new CPTImage instance initialized with the contents of a PNG file. More... | |
Public Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Public Class Methods inherited from <NSSecureCoding> | |
(BOOL) | + supportsSecureCoding: |
Public Instance Methods | |
Initialization | |
(nonnull instancetype) | - initWithContentsOfFile: |
Initializes a CPTImage instance with the contents of a file. More... | |
(nonnull instancetype) | - initWithCGImage:scale: |
Initializes a CPTImage instance with the provided CGImageRef. More... | |
(nonnull instancetype) | - initWithCGImage: |
Initializes a CPTImage instance with the provided CGImageRef and scale 1.0 . More... | |
(nullable instancetype) | - initWithCoder: |
Returns an object initialized from data in a given unarchiver. More... | |
(nonnull instancetype) | - init [implementation] |
Initializes a newly allocated CPTImage object with a NULL image. More... | |
(nonnull instancetype) | - initWithNativeImage: |
Initializes a CPTImage instance with the provided platform-native image. More... | |
(nonnull instancetype) | - initForPNGFile: |
Initializes a CPTImage instance with the contents of a PNG file. More... | |
Drawing | |
(void) | - drawInRect:inContext: |
Draws the image into the given graphics context. More... | |
Comparison | |
(BOOL) | - isEqual: [implementation] |
Returns a boolean value that indicates whether the received is equal to the given object. Images are equal if they have the same scale, tiled, tileAnchoredToContext, image size, color space, bit depth, and image data. More... | |
Public Instance Methods inherited from NSObject | |
(Class) | - classForCoder |
(id) | - copy |
(void) | - dealloc |
(void) | - finalize |
(id) | - init |
(id) | - mutableCopy |
Public Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
Public Instance Methods inherited from <NSCopying> | |
(id) | - copyWithZone: |
Public Instance Methods inherited from <NSCoding> | |
(id) | - initWithCoder: |
(void) | - encodeWithCoder: |
Properties | |
CPTNativeImage * | nativeImage |
A platform-native representation of the image. More... | |
CGImageRef | image |
The image drawn into a CGImageRef. More... | |
CGFloat | scale |
The image scale. Must be greater than zero. More... | |
BOOL | tiled |
Draw as a tiled image? More... | |
CPTEdgeInsets | edgeInsets |
The edge insets for a stretchable image. More... | |
BOOL | tileAnchoredToContext |
Anchor the tiled image to the context origin? More... | |
BOOL | opaque |
If YES, the image is completely opaque. More... | |
A bitmap image.
If initialized from a file or UIImage, and an @2x version of the image file is available, the image will be rendered correctly on Retina and non-Retina displays.
- (void) drawInRect: | (CGRect) | rect | |
inContext: | (nonnull CGContextRef) | context | |
Draws the image into the given graphics context.
If the tiled property is YES, the image is repeatedly drawn to fill the clipping region, otherwise the image is scaled to fit in rect
.
rect | The rectangle to draw into. |
context | The graphics context to draw into. |
+ (nonnull instancetype) imageForPNGFile: | (nonnull NSString *) | path |
Creates and returns a new CPTImage instance initialized with the contents of a PNG file.
On systems that support hi-dpi or “Retina” displays, this method will look for a double-resolution image with the given name followed by “@2x”. If the “@2x” image is not available, the named image file will be loaded.
path | The file system path of the file. |
+ (nonnull instancetype) imageNamed: | (nonnull NSString *) | name |
+ (nonnull instancetype) imageWithCGImage: | (nullable CGImageRef) | anImage |
Creates and returns a new CPTImage instance initialized with the provided CGImageRef and scale 1.0
.
anImage | The image to wrap. |
+ (nonnull instancetype) imageWithCGImage: | (nullable CGImageRef) | anImage | |
scale: | (CGFloat) | newScale | |
Creates and returns a new CPTImage instance initialized with the provided CGImageRef.
anImage | The image to wrap. |
newScale | The image scale. |
+ (nonnull instancetype) imageWithContentsOfFile: | (nonnull NSString *) | path |
+ (nonnull instancetype) imageWithNativeImage: | (nullable CPTNativeImage *) | anImage |
|
implementation |
Initializes a newly allocated CPTImage object with a NULL
image.
- (nonnull instancetype) initForPNGFile: | (nonnull NSString *) | path |
Initializes a CPTImage instance with the contents of a PNG file.
On systems that support hi-dpi or “Retina” displays, this method will look for a double-resolution image with the given name followed by “@2x”. If the “@2x” image is not available, the named image file will be loaded.
path | The file system path of the file. |
Provided by category CPTImage(CPTPlatformSpecificImageExtensions).
- (nonnull instancetype) initWithCGImage: | (nullable CGImageRef) | anImage |
Initializes a CPTImage instance with the provided CGImageRef and scale 1.0
.
anImage | The image to wrap. |
- (nonnull instancetype) initWithCGImage: | (nullable CGImageRef) | anImage | |
scale: | (CGFloat) | newScale | |
Initializes a CPTImage instance with the provided CGImageRef.
This is the designated initializer.
anImage | The image to wrap. |
newScale | The image scale. Must be greater than zero. |
- (nullable instancetype) initWithCoder: | (nonnull NSCoder *) | coder |
Returns an object initialized from data in a given unarchiver.
coder | An unarchiver object. |
- (nonnull instancetype) initWithContentsOfFile: | (nonnull NSString *) | path |
- (nonnull instancetype) initWithNativeImage: | (nullable CPTNativeImage *) | anImage |
Initializes a CPTImage instance with the provided platform-native image.
anImage | The platform-native image. |
Provided by category CPTImage(CPTPlatformSpecificImageExtensions).
Returns a boolean value that indicates whether the received is equal to the given object. Images are equal if they have the same scale, tiled, tileAnchoredToContext, image size, color space, bit depth, and image data.
object | The object to be compared with the receiver. |
|
readwritenonatomicassign |
The edge insets for a stretchable image.
The edge insets define the end caps or regions that do not resize when stretching the image. The middle sections between the end caps are stretched or tiled (as determined by the tiled property) to fill the remaining space in the final image. The default value is CPTEdgeInsetsZero which allows the entire image to stretch or tile to fill the final image size.
|
readwritenonatomicassign |
The image drawn into a CGImageRef.
|
readwritenonatomiccopy |
A platform-native representation of the image.
|
readwritenonatomicassign |
The image scale. Must be greater than zero.
|
readwritenonatomicassign |
Anchor the tiled image to the context origin?
If YES, the origin of the tiled image is anchored to the origin of the drawing context. If NO, the origin of the tiled image is set to the origin of the rectangle passed to -drawInRect:inContext: . The default value is YES. If tiled is NO, this property has no effect.
|
readwritenonatomicassign |