Changeset 21476
- Timestamp:
- 11/03/2007 12:03:34 PM (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Frameworks/AIUtilities Framework/Source/AIImageAdditions.h
r21302 r21476 53 53 - (NSImage *)imageByScalingForMenuItem; 54 54 - (NSImage *)imageByScalingToSize:(NSSize)size fraction:(float)delta flipImage:(BOOL)flipImage proportionally:(BOOL)proportionally allowAnimation:(BOOL)allowAnimation; 55 - (NSSize)sizeInPixels;56 55 //+ (NSImage *)imageFromGWorld:(GWorldPtr)gWorldPtr; 57 56 - (NSRect)drawRoundedInRect:(NSRect)rect radius:(float)radius; trunk/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m
r21302 r21476 419 419 } 420 420 421 - (NSSize)sizeInPixels422 {423 NSImageRep *rep = [self bestRepresentationForDevice:nil];424 return (NSSize){ [rep pixelsWide], [rep pixelsHigh] };425 }426 427 421 //General purpose draw image rounded in a NSRect. 428 422 - (NSRect)drawRoundedInRect:(NSRect)rect radius:(float)radius … … 443 437 444 438 //We use our own size for drawing purposes no matter the passed size to avoid distorting the image via stretching 445 //We use the size in pixels in order to ignore the resolution of the image. Otherwise, the image may come out larger or smaller than the target size. 446 NSSize ownSize = [self sizeInPixels]; 439 NSSize ownSize = [self size]; 447 440 448 441 //If we're passed a 0,0 size, use the image's size for the area taken up by the image