• 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
Drag image of NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag image of NSView


  • Subject: Drag image of NSView
  • From: Ken Tozier <email@hidden>
  • Date: Fri, 14 Oct 2005 22:59:48 -0400

I'm sure this is an easy one but the Apple Drag and Drop info located here "http://developer.apple.com/documentation/Cocoa/Conceptual/ DragandDrop/index.html?http://developer.apple.com/documentation/Cocoa/ Conceptual/DragandDrop/DragandDrop.html" gives no indication of how to actually create a transparent snapshot of an NSView for use as a drag image.

The documentation for NSView's dragImage:at:offset:event:pasteboard:source:slideBack: method shows the following snippet for getting the image

[pboard setData:[[self image] TIFFRepresentation] forType:NSTIFFPboardType];
[self dragImage:[self image] at:[self imageLocation] offset:dragOffset event:theEvent pasteboard:pboard source:self slideBack:YES];


Problem is though, NSView has no "image" method. Nor do it's superclasses "NSResponder" or "NSObject" so where are they getting the image? Is this some deprecated method of NSView?

Anyway. If there is some better documentation around or if someone could provide a simple code snippet of how to get a transparent image of a view for a drag icon, it would be much appreciated

Thanks for any help

Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Drag image of NSView
      • From: John Pannell <email@hidden>
  • Prev by Date: First-Time Help Needed: Instantiating a Subclass in IB
  • Next by Date: Re: First-Time Help Needed: Instantiating a Subclass in IB
  • Previous by thread: Re: First-Time Help Needed: Instantiating a Subclass in IB
  • Next by thread: Re: Drag image of NSView
  • Index(es):
    • Date
    • Thread