• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Capturing portion of an NSView for drag-and-drop image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Capturing portion of an NSView for drag-and-drop image
  • From: Andrew Platzer <email@hidden>
  • Date: Fri, 18 May 2001 12:38:00 -0700

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>)

  • Prev by Date: Re: Error codes?
  • Next by Date: Re: Menu bar
  • Previous by thread: Capturing portion of an NSView for drag-and-drop image
  • Next by thread: Re: Capturing portion of an NSView for drag-and-drop image
  • Index(es):
    • Date
    • Thread