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



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

Typically you don't get an NSImage, but rather you create one and draw into it.

Create an NSImage, lock focus onto it, do your drawing, and unlock focus.

This is not precisely screen capture; screen capture is about grabbing the bits that have been drawn on the screen, from whatever source. However, it sounds like it more closely matches what you want to do.

Douglas Davidson


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.