• 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
Capturing portion of an NSView for drag-and-drop image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Capturing portion of an NSView for drag-and-drop image
  • From: Brad Werth <email@hidden>
  • Date: Fri, 18 May 2001 09:34:32 -0700
  • Organization: ORCAS, Inc.

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:

- (NSData *)dataWithEPSInsideRect:(NSRect)aRect
or
- (NSData *)dataWithPDFInsideRect:(NSRect)aRect

I tried them both and they both failed differently. The PDF version
complained when the message was sent and the resulting image contained
only a portion of the border of the NSCell I was trying to capture, but
it was the correct size. The EPS version didn't complain, but the
resulting data couldn't be parsed correctly as EPS. Not certain why --
I wrote it out to a file to look at it (TextView was the only thing I
could find that would open it). All I noticed is that the header did
NOT contain the "%%BoundingBox:" comment that NSEPSImageRep says is
necessary to parse the data. What gives?

Anyway, I'm almost certain that I'm doing this the hard way, and was
hoping that anyone who has written something to do screen capture could
help me out.

Thanks,
Brad Werth
email@hidden


  • Follow-Ups:
    • Re: Capturing portion of an NSView for drag-and-drop image
      • From: Douglas Davidson <email@hidden>
    • Re: Capturing portion of an NSView for drag-and-drop image
      • From: Chuck Pisula <email@hidden>
    • Re: Capturing portion of an NSView for drag-and-drop image
      • From: Andrew Platzer <email@hidden>
  • Prev by Date: Re: Error codes?
  • Next by Date: Serial port support
  • Previous by thread: Re: Menu bar
  • Next by thread: Re: Capturing portion of an NSView for drag-and-drop image
  • Index(es):
    • Date
    • Thread