• 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: How do I convert data in NSString to NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I convert data in NSString to NSImage


  • Subject: Re: How do I convert data in NSString to NSImage
  • From: Ivan Myrvold <email@hidden>
  • Date: Wed, 10 Sep 2003 09:23:12 +0200

Got it working this way:

NSString *picstr; // the string with jpeg data
NSData *picdata = [NSData dataWithBytes:[picstr cString] length:[picstr cStringLength]]; // now picdata contains the jpeg data
NSImage *myPicture = [[NSImage alloc] initWithData:picdata]; // now we have the NSImage

Ivan

Pe onsdag, 10. september 2003, kl. 08:14, skrev Ivan Myrvold:

I have jpeg that is read in to an NSString. How do I convert this to an NSImage?\

Ivan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How do I convert data in NSString to NSImage
      • From: Chris Ridd <email@hidden>
References: 
 >How do I convert data in NSString to NSImage (From: Ivan Myrvold <email@hidden>)

  • Prev by Date: Newbie question - is where Obj-C analog for a C++ static data members?
  • Next by Date: Re: How do I convert data in NSString to NSImage
  • Previous by thread: How do I convert data in NSString to NSImage
  • Next by thread: Re: How do I convert data in NSString to NSImage
  • Index(es):
    • Date
    • Thread