org.rococoa.cocoa.appkit
Class NSImage

java.lang.Object
  extended by org.rococoa.cocoa.foundation.NSObject
      extended by org.rococoa.cocoa.appkit.NSImage
All Implemented Interfaces:
NSPasteboardWriting, NSCoding, NSCopying, NSObject, ObjCObject

public abstract class NSImage
extends NSObject
implements ObjCObject, NSCopying, NSCoding, NSPasteboardWriting

This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java, Rococoa, or JNA.


Nested Class Summary
static class NSImage.__imageFlags
           
static class NSImage._class_
           
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSCopying
NSCopying._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
NSCoding._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.appkit.protocols.NSPasteboardWriting
NSPasteboardWriting._static_
 
Constructor Summary
NSImage()
           
 
Method Summary
abstract  NSString accessibilityDescription()
          An accessibility description can be set on an image.
abstract  void addRepresentation(NSImageRep imageRep)
          Original signature : -(void)addRepresentation:(NSImageRep*)
native declaration : NSImage.h:120
abstract  void addRepresentations(NSArray imageReps)
          Original signature : -(void)addRepresentations:(NSArray*)
native declaration : NSImage.h:119
abstract  NSObject alignmentRect()
          The alignmentRect of an image is metadata that a client may use to help determine layout.
static NSImage alloc()
           
abstract  NSColor backgroundColor()
          Original signature : -(NSColor*)backgroundColor
native declaration : NSImage.h:103
abstract  NSImageRep bestRepresentationForDevice(NSDictionary deviceDescription)
          use -[NSImage bestRepresentationForRect:context:hints:] instead.
abstract  NSImageRep bestRepresentationForRect_context_hints(NSRect.ByValue rect, NSGraphicsContext referenceContext, NSDictionary hints)
          Select best representation.
abstract  int cacheMode()
          Original signature : -(NSImageCacheMode)cacheMode
native declaration : NSImage.h:152
abstract  void cancelIncrementalLoad()
          Original signature : -(void)cancelIncrementalLoad
native declaration : NSImage.h:149
static boolean canInitWithPasteboard(NSPasteboard pasteboard)
          Original signature : +(BOOL)canInitWithPasteboard:(NSPasteboard*)
native declaration : NSImage.h:146
abstract  NSObject CGImageForProposedRect_context_hints(NSRect proposedDestRect, NSGraphicsContext referenceContext, NSDictionary hints)
          Returns a CGImage capturing the drawing of the receiver.
static NSImage createByReferencingFile(NSString fileName)
          Factory method
static NSImage createByReferencingURL(NSURL url)
          Factory method
static NSImage createWithContentsOfFile(NSString fileName)
          Factory method
static NSImage createWithContentsOfURL(NSURL url)
          Factory method
static NSImage createWithData(NSData data)
          Factory method
static NSImage createWithDataIgnoringOrientation(NSData data)
          Factory method
static NSImage createWithPasteboard(NSPasteboard pasteboard)
          Factory method
static NSImage createWithSize(NSSize.ByValue aSize)
          Factory method
abstract  NSImageDelegate delegate()
          Original signature : -(id)delegate
native declaration : NSImage.h:132
static NSImage._class_ getNSClass()
           
abstract  boolean hitTestRect_withImageDestinationRect_context_hints_flipped(NSRect.ByValue testRectDestSpace, NSRect.ByValue imageRectDestSpace, NSGraphicsContext context, NSDictionary hints, boolean flipped)
          Answers the question, "If you were to draw the image in the passed destination rect in the passed context respecting the passed flippedness with the passed hints, would the test rect in the context intersect a non-transparent portion of the image?"
static NSArray imageFileTypes()
          Original signature : +(NSArray*)imageFileTypes
native declaration : NSImage.h:138
static NSObject imageNamed(NSString name)
          If this finds & creates the image, only name is saved when archived
Original signature : +(id)imageNamed:(NSString*)
native declaration : NSImage.h:80
static NSArray imagePasteboardTypes()
          Original signature : +(NSArray*)imagePasteboardTypes
native declaration : NSImage.h:139
static NSArray imageTypes()
          Original signature : +(NSArray*)imageTypes
native declaration : NSImage.h:142
static NSArray imageUnfilteredFileTypes()
          These return union of all the types registered with NSImageRep.
static NSArray imageUnfilteredPasteboardTypes()
          Original signature : +(NSArray*)imageUnfilteredPasteboardTypes
native declaration : NSImage.h:137
static NSArray imageUnfilteredTypes()
          Original signature : +(NSArray*)imageUnfilteredTypes
native declaration : NSImage.h:143
abstract  NSImage initByReferencingFile(NSString fileName)
          When archived, saves fileName
Original signature : -(id)initByReferencingFile:(NSString*)
native declaration : NSImage.h:86
abstract  NSImage initByReferencingURL(NSURL url)
          When archived, saves url, supports progressive loading
Original signature : -(id)initByReferencingURL:(NSURL*)
native declaration : NSImage.h:88
abstract  NSImage initWithContentsOfFile(NSString fileName)
          When archived, saves contents
Original signature : -(id)initWithContentsOfFile:(NSString*)
native declaration : NSImage.h:84
abstract  NSImage initWithContentsOfURL(NSURL url)
          When archived, saves contents
Original signature : -(id)initWithContentsOfURL:(NSURL*)
native declaration : NSImage.h:85
abstract  NSImage initWithData(NSData data)
          When archived, saves contents
Original signature : -(id)initWithData:(NSData*)
native declaration : NSImage.h:83
abstract  NSImage initWithDataIgnoringOrientation(NSData data)
          not for general use, but useful for compatibility with old NSImage behavior.
abstract  NSImage initWithPasteboard(NSPasteboard pasteboard)
          Original signature : -(id)initWithPasteboard:(NSPasteboard*)
native declaration : NSImage.h:93
abstract  NSImage initWithSize(NSSize.ByValue aSize)
          Original signature : -(id)initWithSize:(NSSize)
native declaration : NSImage.h:82
abstract  boolean isTemplate()
          The 'template' property is metadata that allows clients to be smarter about image processing.
abstract  boolean isValid()
          Original signature : -(BOOL)isValid
native declaration : NSImage.h:123
abstract  void lockFocus()
          Original signature : -(void)lockFocus
native declaration : NSImage.h:124
abstract  void lockFocusFlipped(boolean flipped)
          Original signature : -(void)lockFocusFlipped:(BOOL)
native declaration : NSImage.h:125
abstract  boolean matchesOnMultipleResolution()
          Original signature : -(BOOL)matchesOnMultipleResolution
native declaration : NSImage.h:109
abstract  NSString name()
          Original signature : -(NSString*)name
native declaration : NSImage.h:101
static NSImage new_()
           
abstract  boolean prefersColorMatch()
          Original signature : -(BOOL)prefersColorMatch
native declaration : NSImage.h:107
abstract  void recache()
          Original signature : -(void)recache
native declaration : NSImage.h:114
abstract  void removeRepresentation(NSImageRep imageRep)
          Original signature : -(void)removeRepresentation:(NSImageRep*)
native declaration : NSImage.h:121
abstract  NSArray representations()
          Original signature : -(NSArray*)representations
native declaration : NSImage.h:118
abstract  void setAccessibilityDescription(NSString description)
          Original signature : -(void)setAccessibilityDescription:(NSString*)
native declaration : NSImage.h:178
abstract  void setBackgroundColor(NSColor aColor)
          Original signature : -(void)setBackgroundColor:(NSColor*)
native declaration : NSImage.h:102
abstract  void setCacheMode(int mode)
          Original signature : -(void)setCacheMode:(NSImageCacheMode)
native declaration : NSImage.h:151
abstract  void setDelegate(NSImageDelegate anObject)
          Original signature : -(void)setDelegate:(id)
native declaration : NSImage.h:131
abstract  void setMatchesOnMultipleResolution(boolean flag)
          Original signature : -(void)setMatchesOnMultipleResolution:(BOOL)
native declaration : NSImage.h:108
abstract  boolean setName(NSString string)
          Original signature : -(BOOL)setName:(NSString*)
native declaration : NSImage.h:100
abstract  void setPrefersColorMatch(boolean flag)
          Original signature : -(void)setPrefersColorMatch:(BOOL)
native declaration : NSImage.h:106
abstract  void setSize(NSSize.ByValue aSize)
          Original signature : -(void)setSize:(NSSize)
native declaration : NSImage.h:98
abstract  void setTemplate(boolean isTemplate)
          Original signature : -(void)setTemplate:(BOOL)
native declaration : NSImage.h:172
abstract  void setUsesEPSOnResolutionMismatch(boolean flag)
          Original signature : -(void)setUsesEPSOnResolutionMismatch:(BOOL)
native declaration : NSImage.h:104
abstract  NSSize.ByValue size()
          Original signature : -(NSSize)size
native declaration : NSImage.h:99
abstract  NSData TIFFRepresentation()
          Original signature : -(NSData*)TIFFRepresentation
native declaration : NSImage.h:115
abstract  void unlockFocus()
          Original signature : -(void)unlockFocus
native declaration : NSImage.h:126
abstract  boolean usesEPSOnResolutionMismatch()
          Original signature : -(BOOL)usesEPSOnResolutionMismatch
native declaration : NSImage.h:105
 
Methods inherited from class org.rococoa.cocoa.foundation.NSObject
as_NSObject_NSAccessibility, as_NSObject_NSAccessibilityAdditions, as_NSObject_NSApplicationScriptingDelegation, as_NSObject_NSArchiverCallback, as_NSObject_NSClassDescriptionPrimitives, as_NSObject_NSCoderMethods, as_NSObject_NSColorPanelResponderMethod, as_NSObject_NSComparisonMethods, as_NSObject_NSControlSubclassNotifications, as_NSObject_NSCopyLinkMoveHandler, as_NSObject_NSDelayedPerforming, as_NSObject_NSDeprecatedKeyValueCoding, as_NSObject_NSDeprecatedKeyValueObservingCustomization, as_NSObject_NSDeprecatedMethods, as_NSObject_NSDictionaryControllerKeyValuePair, as_NSObject_NSDistributedObjects, as_NSObject_NSDraggingDestination, as_NSObject_NSDraggingSource, as_NSObject_NSDraggingSourceDeprecated, as_NSObject_NSEditor, as_NSObject_NSEditorRegistration, as_NSObject_NSErrorRecoveryAttempting, as_NSObject_NSFileManagerFileOperationAdditions, as_NSObject_NSFontManagerDelegate, as_NSObject_NSFontManagerResponderMethod, as_NSObject_NSFontPanelValidationAdditions, as_NSObject_NSKeyValueBindingCreation, as_NSObject_NSKeyValueCoding, as_NSObject_NSKeyValueObserverNotification, as_NSObject_NSKeyValueObserverRegistration, as_NSObject_NSKeyValueObserving, as_NSObject_NSKeyValueObservingCustomization, as_NSObject_NSMenuValidation, as_NSObject_NSNibAwaking, as_NSObject_NSPasteboardOwner, as_NSObject_NSPlaceholders, as_NSObject_NSScriptClassDescription, as_NSObject_NSScripting, as_NSObject_NSScriptingComparisonMethods, as_NSObject_NSScriptKeyValueCoding, as_NSObject_NSScriptObjectSpecifiers, as_NSObject_NSThreadPerformAdditions, as_NSObject_NSURLClient, as_NSObject_NSURLConnectionDelegate, as_NSObject_NSURLDownloadDelegate, copy, create, dealloc, description, doesNotRecognizeSelector, finalize, forwardingTargetForSelector, forwardInvocation, init, isKindOfClass, isKindOfClass, methodForSelector, methodSignatureForSelector, mutableCopy, release, retain, retainCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSCopying
copyWithZone
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
encodeWithCoder, initWithCoder
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
autorelease, class_, conformsToProtocol, hash, isEqual, isMemberOfClass, isProxy, performSelector_withObject_withObject, performSelector_withObject, performSelector, respondsToSelector, self, superclass, zone
 
Methods inherited from interface org.rococoa.ObjCObject
id
 

Constructor Detail

NSImage

public NSImage()
Method Detail

imageNamed

public static NSObject imageNamed(NSString name)
If this finds & creates the image, only name is saved when archived
Original signature : +(id)imageNamed:(NSString*)
native declaration : NSImage.h:80


initWithSize

public abstract NSImage initWithSize(NSSize.ByValue aSize)
Original signature : -(id)initWithSize:(NSSize)
native declaration : NSImage.h:82


createWithSize

public static NSImage createWithSize(NSSize.ByValue aSize)
Factory method

See Also:
initWithSize(org.rococoa.cocoa.foundation.NSSize.ByValue)

initWithData

public abstract NSImage initWithData(NSData data)
When archived, saves contents
Original signature : -(id)initWithData:(NSData*)
native declaration : NSImage.h:83


createWithData

public static NSImage createWithData(NSData data)
Factory method

See Also:
initWithData(org.rococoa.cocoa.foundation.NSData)

initWithContentsOfFile

public abstract NSImage initWithContentsOfFile(NSString fileName)
When archived, saves contents
Original signature : -(id)initWithContentsOfFile:(NSString*)
native declaration : NSImage.h:84


createWithContentsOfFile

public static NSImage createWithContentsOfFile(NSString fileName)
Factory method

See Also:
initWithContentsOfFile(org.rococoa.cocoa.foundation.NSString)

initWithContentsOfURL

public abstract NSImage initWithContentsOfURL(NSURL url)
When archived, saves contents
Original signature : -(id)initWithContentsOfURL:(NSURL*)
native declaration : NSImage.h:85


createWithContentsOfURL

public static NSImage createWithContentsOfURL(NSURL url)
Factory method

See Also:
initWithContentsOfURL(org.rococoa.cocoa.foundation.NSURL)

initByReferencingFile

public abstract NSImage initByReferencingFile(NSString fileName)
When archived, saves fileName
Original signature : -(id)initByReferencingFile:(NSString*)
native declaration : NSImage.h:86


createByReferencingFile

public static NSImage createByReferencingFile(NSString fileName)
Factory method

See Also:
initByReferencingFile(org.rococoa.cocoa.foundation.NSString)

initByReferencingURL

public abstract NSImage initByReferencingURL(NSURL url)
When archived, saves url, supports progressive loading
Original signature : -(id)initByReferencingURL:(NSURL*)
native declaration : NSImage.h:88


createByReferencingURL

public static NSImage createByReferencingURL(NSURL url)
Factory method

See Also:
initByReferencingURL(org.rococoa.cocoa.foundation.NSURL)

initWithPasteboard

public abstract NSImage initWithPasteboard(NSPasteboard pasteboard)
Original signature : -(id)initWithPasteboard:(NSPasteboard*)
native declaration : NSImage.h:93


createWithPasteboard

public static NSImage createWithPasteboard(NSPasteboard pasteboard)
Factory method

See Also:
initWithPasteboard(org.rococoa.cocoa.appkit.NSPasteboard)

initWithDataIgnoringOrientation

public abstract NSImage initWithDataIgnoringOrientation(NSData data)
not for general use, but useful for compatibility with old NSImage behavior. Ignore exif orientation tags in JPEG and such. See AppKit release notes.
Original signature : -(id)initWithDataIgnoringOrientation:(NSData*)
native declaration : NSImage.h:96


createWithDataIgnoringOrientation

public static NSImage createWithDataIgnoringOrientation(NSData data)
Factory method

See Also:
initWithDataIgnoringOrientation(org.rococoa.cocoa.foundation.NSData)

setSize

public abstract void setSize(NSSize.ByValue aSize)
Original signature : -(void)setSize:(NSSize)
native declaration : NSImage.h:98


size

public abstract NSSize.ByValue size()
Original signature : -(NSSize)size
native declaration : NSImage.h:99


setName

public abstract boolean setName(NSString string)
Original signature : -(BOOL)setName:(NSString*)
native declaration : NSImage.h:100


name

public abstract NSString name()
Original signature : -(NSString*)name
native declaration : NSImage.h:101


setBackgroundColor

public abstract void setBackgroundColor(NSColor aColor)
Original signature : -(void)setBackgroundColor:(NSColor*)
native declaration : NSImage.h:102


backgroundColor

public abstract NSColor backgroundColor()
Original signature : -(NSColor*)backgroundColor
native declaration : NSImage.h:103


setUsesEPSOnResolutionMismatch

public abstract void setUsesEPSOnResolutionMismatch(boolean flag)
Original signature : -(void)setUsesEPSOnResolutionMismatch:(BOOL)
native declaration : NSImage.h:104


usesEPSOnResolutionMismatch

public abstract boolean usesEPSOnResolutionMismatch()
Original signature : -(BOOL)usesEPSOnResolutionMismatch
native declaration : NSImage.h:105


setPrefersColorMatch

public abstract void setPrefersColorMatch(boolean flag)
Original signature : -(void)setPrefersColorMatch:(BOOL)
native declaration : NSImage.h:106


prefersColorMatch

public abstract boolean prefersColorMatch()
Original signature : -(BOOL)prefersColorMatch
native declaration : NSImage.h:107


setMatchesOnMultipleResolution

public abstract void setMatchesOnMultipleResolution(boolean flag)
Original signature : -(void)setMatchesOnMultipleResolution:(BOOL)
native declaration : NSImage.h:108


matchesOnMultipleResolution

public abstract boolean matchesOnMultipleResolution()
Original signature : -(BOOL)matchesOnMultipleResolution
native declaration : NSImage.h:109


recache

public abstract void recache()
Original signature : -(void)recache
native declaration : NSImage.h:114


TIFFRepresentation

public abstract NSData TIFFRepresentation()
Original signature : -(NSData*)TIFFRepresentation
native declaration : NSImage.h:115


representations

public abstract NSArray representations()
Original signature : -(NSArray*)representations
native declaration : NSImage.h:118


addRepresentations

public abstract void addRepresentations(NSArray imageReps)
Original signature : -(void)addRepresentations:(NSArray*)
native declaration : NSImage.h:119


addRepresentation

public abstract void addRepresentation(NSImageRep imageRep)
Original signature : -(void)addRepresentation:(NSImageRep*)
native declaration : NSImage.h:120


removeRepresentation

public abstract void removeRepresentation(NSImageRep imageRep)
Original signature : -(void)removeRepresentation:(NSImageRep*)
native declaration : NSImage.h:121


isValid

public abstract boolean isValid()
Original signature : -(BOOL)isValid
native declaration : NSImage.h:123


lockFocus

public abstract void lockFocus()
Original signature : -(void)lockFocus
native declaration : NSImage.h:124


lockFocusFlipped

public abstract void lockFocusFlipped(boolean flipped)
Original signature : -(void)lockFocusFlipped:(BOOL)
native declaration : NSImage.h:125


unlockFocus

public abstract void unlockFocus()
Original signature : -(void)unlockFocus
native declaration : NSImage.h:126


bestRepresentationForDevice

public abstract NSImageRep bestRepresentationForDevice(NSDictionary deviceDescription)
use -[NSImage bestRepresentationForRect:context:hints:] instead. Any deviceDescription dictionary is also a valid hints dictionary.
Original signature : -(NSImageRep*)bestRepresentationForDevice:(NSDictionary*)
native declaration : NSImage.h:129


setDelegate

public abstract void setDelegate(NSImageDelegate anObject)
Original signature : -(void)setDelegate:(id)
native declaration : NSImage.h:131


delegate

public abstract NSImageDelegate delegate()
Original signature : -(id)delegate
native declaration : NSImage.h:132


imageUnfilteredFileTypes

public static NSArray imageUnfilteredFileTypes()
These return union of all the types registered with NSImageRep.
Original signature : +(NSArray*)imageUnfilteredFileTypes
native declaration : NSImage.h:136


imageUnfilteredPasteboardTypes

public static NSArray imageUnfilteredPasteboardTypes()
Original signature : +(NSArray*)imageUnfilteredPasteboardTypes
native declaration : NSImage.h:137


imageFileTypes

public static NSArray imageFileTypes()
Original signature : +(NSArray*)imageFileTypes
native declaration : NSImage.h:138


imagePasteboardTypes

public static NSArray imagePasteboardTypes()
Original signature : +(NSArray*)imagePasteboardTypes
native declaration : NSImage.h:139


imageTypes

public static NSArray imageTypes()
Original signature : +(NSArray*)imageTypes
native declaration : NSImage.h:142


imageUnfilteredTypes

public static NSArray imageUnfilteredTypes()
Original signature : +(NSArray*)imageUnfilteredTypes
native declaration : NSImage.h:143


canInitWithPasteboard

public static boolean canInitWithPasteboard(NSPasteboard pasteboard)
Original signature : +(BOOL)canInitWithPasteboard:(NSPasteboard*)
native declaration : NSImage.h:146


cancelIncrementalLoad

public abstract void cancelIncrementalLoad()
Original signature : -(void)cancelIncrementalLoad
native declaration : NSImage.h:149


setCacheMode

public abstract void setCacheMode(int mode)
Original signature : -(void)setCacheMode:(NSImageCacheMode)
native declaration : NSImage.h:151

Parameters:
mode - @see org.rococoa.cocoa.appkit.AppKitLibrary#NSImageCacheMode

cacheMode

public abstract int cacheMode()
Original signature : -(NSImageCacheMode)cacheMode
native declaration : NSImage.h:152


alignmentRect

public abstract NSObject alignmentRect()
The alignmentRect of an image is metadata that a client may use to help determine layout. The bottom of the rect gives the baseline of the image. The other edges give similar information in other directions.
A 20x20 image of a phone icon with a glow might specify an alignmentRect of {{2,2},{16,16}} that excludes the glow. NSButtonCell can take advantage of the alignmentRect to place the image in the same visual location as an 16x16 phone icon without the glow. A 5x5 star that should render high when aligned with text might specify a rect of {{0,-7},{5,12}}.
The alignmentRect of an image has no effect on methods such as drawInRect:fromRect:operation:Fraction: or drawAtPoint:fromRect:operation:fraction:. It is the client's responsibility to take the alignmentRect into account where applicable.
The default alignmentRect of an image is {{0,0},imageSize}. The rect is adjusted when setSize: is called.
Original signature : -(id)alignmentRect
native declaration : NSImage.h:164


isTemplate

public abstract boolean isTemplate()
The 'template' property is metadata that allows clients to be smarter about image processing. An image should be marked as a template if it is basic glpyh-like black and white art that is intended to be processed into derived images for use on screen.
NSButtonCell applies effects to images based on the state of the button. For example, images are shaded darker when the button is pressed. If a template image is set on a cell, the cell can apply more sophisticated effects. For example, it may be processed into an image that looks engraved when drawn into a cell whose interiorBackgroundStyle is NSBackgroundStyleRaised, like on a textured button.
Original signature : -(BOOL)isTemplate
native declaration : NSImage.h:171


setTemplate

public abstract void setTemplate(boolean isTemplate)
Original signature : -(void)setTemplate:(BOOL)
native declaration : NSImage.h:172


accessibilityDescription

public abstract NSString accessibilityDescription()
An accessibility description can be set on an image. This description will be used automatically by interface elements that display images. Like all accessibility descriptions, the string should be a short localized string that does not include the name of the interface element. For instance, "delete" rather than "delete button".
Original signature : -(NSString*)accessibilityDescription
native declaration : NSImage.h:177


setAccessibilityDescription

public abstract void setAccessibilityDescription(NSString description)
Original signature : -(void)setAccessibilityDescription:(NSString*)
native declaration : NSImage.h:178


CGImageForProposedRect_context_hints

public abstract NSObject CGImageForProposedRect_context_hints(NSRect proposedDestRect,
                                                              NSGraphicsContext referenceContext,
                                                              NSDictionary hints)
Returns a CGImage capturing the drawing of the receiver. This method returns an existing CGImage if one is available, or creates one if not. It behaves the same as drawing the image with respect to caching and related behaviors. This method is typically called, not overridden.
An NSImage is potentially resolution independent, and may have representations that allow it to draw well in many contexts. A CGImage is more like a single pixel-based representation. This method produces a snapshot of how the NSImage would draw if it was asked to draw in *proposedDestRect in the passed context. Producing this snapshot may be more expensive than just drawing the NSImage, so prefer to use -[NSImage drawInRect:fromRect:operation:fraction:] unless you require a CGImage.
The return value in *proposedDestRect tells the client where to draw the CGImage. This rect may be outset from the requested rect, because a CGImage must have pixel-integral dimensions while an NSImage need not.
All input parameters are optional. They provide hints for how to choose among existing CGImages, or how to create one if there isn't already a CGImage available. The parameters are _only_ hints. Any CGImage is a valid return.
If proposedDestRect is NULL, it defaults to the smallest pixel-integral rectangle containing {{0,0}, [self size]}. The proposedDestRect is in user space in the reference context.
If referenceContext is nil, the method behaves as if a window context scaled by the default user space scaling factor was passed, though no context is actually created. The properties of the context are used as hints for choosing the best representation and for creating a CGImage if creation is necessary. It also provides the coordinate space in which the proposedDestRect is interpreted. Only the snapshotted state of the context at the moment its passed to this method is relevant. Future changes to the context have no bearing on image behavior.
The hints provide more context for selecting or generating a CGImage, and may override properties of the referenceContext. Hints may be nil. Any entries in a device description dictionary (see NSScreen) are valid, as are all CIContext creation options, plus a few extra hints defined below. Unrecognized hints are ignored, but passed down to image reps (see -[NSImageRep CGImageForProposedRect:context:hints:]). Explicit hints are particularly useful when it is not draw time and you don't have a context to pass in. For example, if you want to pass a rect in pixels for proposedDestRect, you should pass a dictionary with the identity transform for NSImageHintCTM.
This method will always return a valid CGImage provided the NSImage is able to draw. If the receiver is unable to draw for whatever reason, the error behavior is the same as when drawing the image.
The CGImageRef returned is guaranteed to live as long as the current autorelease pool. The caller should not release the CGImage. This is the standard Cocoa convention, but people may not realize that it applies to CFTypes.
Original signature : -(id)CGImageForProposedRect:(NSRect*) context:(NSGraphicsContext*) hints:(NSDictionary*)
native declaration : NSImage.h:208


bestRepresentationForRect_context_hints

public abstract NSImageRep bestRepresentationForRect_context_hints(NSRect.ByValue rect,
                                                                   NSGraphicsContext referenceContext,
                                                                   NSDictionary hints)
Select best representation. The parameters have the same meaning and behavior as in -CGImageForProposedRect:context:hints:.
Original signature : -(NSImageRep*)bestRepresentationForRect:(NSRect) context:(NSGraphicsContext*) hints:(NSDictionary*)
native declaration : NSImage.h:212


hitTestRect_withImageDestinationRect_context_hints_flipped

public abstract boolean hitTestRect_withImageDestinationRect_context_hints_flipped(NSRect.ByValue testRectDestSpace,
                                                                                   NSRect.ByValue imageRectDestSpace,
                                                                                   NSGraphicsContext context,
                                                                                   NSDictionary hints,
                                                                                   boolean flipped)
Answers the question, "If you were to draw the image in the passed destination rect in the passed context respecting the passed flippedness with the passed hints, would the test rect in the context intersect a non-transparent portion of the image?"
Original signature : -(BOOL)hitTestRect:(NSRect) withImageDestinationRect:(NSRect) context:(NSGraphicsContext*) hints:(NSDictionary*) flipped:(BOOL)
native declaration : NSImage.h:216


alloc

public static NSImage alloc()

new_

public static NSImage new_()

getNSClass

public static NSImage._class_ getNSClass()


Copyright © 2009. All Rights Reserved.