• 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
Getting NSData out of an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting NSData out of an NSImage


  • Subject: Getting NSData out of an NSImage
  • From: "Bobby B" <email@hidden>
  • Date: Fri, 7 Apr 2006 19:38:31 -0400

Hey guys!

I feel bad posting this so soon after my fiasco with the tooltips..

Here's what I want to do.

I have an NSImage that I load from a file.  I load it, and I draw on
it.  Now, I want to take this image and put it into a NSData format,
to store it as a binary attribute in a CoreData program.

I can't seem to figure out how to get an NSData representation of
NSImage.  I can do it the other way (get an NSImage from NSData), but
that doesn't help.  I looked at NSBitmapImageRep, but that didn't help
because it didn't allow me a way to draw to it like I did in NSImage
(I just used drawAtPoint withAttributes:, I just needed to draw a
string.)

The point of all this is to draw a little string on a graphic and put
it into a coredata database so that it can be recalled later.

I could even get this all to work if I could somehow save an NSImage
as a file.  Or, maybe it's possible to copy the NSImage to the
clipboard and paste it as NSData?

I hope everyone is doing ok,
Bobby
 _______________________________________________
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: Getting NSData out of an NSImage
      • From: "John C. Randolph" <email@hidden>
    • Re: Getting NSData out of an NSImage
      • From: Scott Thompson <email@hidden>
    • Re: Getting NSData out of an NSImage
      • From: Paul Lynch <email@hidden>
  • Prev by Date: Re: Should I use Sync Services?
  • Next by Date: Getting accessoryView setting into runOperationModalForWindow.
  • Previous by thread: 'valueForUndefinedKey' when the 'key' accessor already exists ... *SOLVED!*
  • Next by thread: Re: Getting NSData out of an NSImage
  • Index(es):
    • Date
    • Thread