| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I'm doing some dragging out of an NSImageView subclass, and I want the "dragImage" to be not the original image that is scaled down to fit inside the NSImageView, but a copy of the image that it the same size as what's displayed. (Otherwise, the original image, which is much bigger, pops up out of seemingly nowhere!)
I can ask the NSImageView for its size, and size the image to be that -- but that doesn't handle the proportions correctly, so the image is still not right.
Any suggestions for asking the NSImageView, or its NSImage, what size it is *currently* displaying at?
// CODE SNIPPET -- CLOSE, BUT NOT QUITE.
- dragImage
{
#warning -- not quite right.
NSSize viewSize = [self bounds].size;
NSImage *newImage = [[[self image] copy] autorelease];
[newImage setScalesWhenResized:YES];
[newImage setSize:viewSize];
return newImage;
}
| References: | |
| >Getting actual size of NSImage in NSImageView? (From: email@hidden) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.