• 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: Convert PICT to NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert PICT to NSImage


  • Subject: Re: Convert PICT to NSImage
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Mon, 27 Jun 2005 23:01:16 +0200

At 9:34 Uhr -0700 27.06.2005, Ian was here wrote:
NSPICTImageRep	*pictImage = [NSPICTImageRep
imageRepWithData:[NSData dataWithBytes:Pict
length:GetHandleSize( (Handle)Pict )]];

A Handle is a pointer to a pointer. You have to de-reference it once to get at the actual bytes.


Also note that NSImage (as far as I've been able to find out so far) doesn't honor the transparency information inside a PICT. If you need that, you'll have to open an NSImage for drawing, get the Carbon GrafPort for the current CGContext, use Quickdraw routines to fill it with a color that isn't in the PICT and draw the PICT with transparency, and then loop over the NSImage's pixels to turn all the remaining colored pixels transparent.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
References: 
 >Convert PICT to NSImage (From: Ian was here <email@hidden>)

  • Prev by Date: Re: How do I create a NSArray of NSString constants?
  • Next by Date: RemoveWindowProxy in Cocoa
  • Previous by thread: Re: Convert PICT to NSImage
  • Next by thread: Re: Convert PICT to NSImage
  • Index(es):
    • Date
    • Thread