Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capturing portion of an NSView for drag-and-drop image



On Friday, May 18, 2001, at 09:34 , Brad Werth wrote:
I'm trying to implement drag-and-drop functionality between two
NSMatrixes. I would like to take a "snapshot" of the visual state of a
NSCell to use as the dragging image. I couldn't find a way to just get
an NSImage * from anything, but it seemed like one of the following
methods of NSView would do it for me:

Usual way:

NSImage* image;
NSBitmapImageRep* rep;
[view lockFocus];
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[view bounds]];
[view unlockFocus];
image = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease];
[image addRepresentation:rep];
[rep release];

Andrew
__________________________________________________________________
A n d r e w P l a t z e r
A p p l i c a t i o n F r a m e w o r k s
A p p l e


References: 
 >Capturing portion of an NSView for drag-and-drop image (From: Brad Werth <email@hidden>)



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.