• 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: String Larson <email@hidden>
  • Date: Mon, 27 Jun 2005 12:08:05 -0500

How are you obtaining 'Pict' ?
Are you sure that a) there is data and b) the data conforms to PICT file format ?


You could try
NSImage *img = [[NSImage alloc] initWithContentsOfFIle:@"file"];
NSArray *reps = [img representations];

to see if there is an NSPICTImageRep being generated ?



On Jun 27, 2005, at 11:34 AM, Ian was here wrote:

I'm trying to convert a PICT into an NSImage and am
having no luck at it. The following code fails. Has
anyone been successful at this? Thanks.



HLock( (Handle)Pict );

NSPICTImageRep    *pictImage = [NSPICTImageRep
imageRepWithData:[NSData dataWithBytes:Pict
length:GetHandleSize( (Handle)Pict )]];

if ( pictImage == nil )
{
 NSLog(@"failed");
}

HUnlock( (Handle)Pict );


[newImage lockFocus]; [pictImage drawAtPoint:NSZeroPoint]; [newImage unlockFocus];




____________________________________________________ Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com _______________________________________________ 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


_______________________________________________ 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: Convert PICT to NSImage
      • From: Ian was here <email@hidden>
References: 
 >Convert PICT to NSImage (From: Ian was here <email@hidden>)

  • Prev by Date: NSXMLParser trouble
  • Next by Date: Re: [SOLVED] NSXMLParser trouble
  • Previous by thread: Convert PICT to NSImage
  • Next by thread: Re: Convert PICT to NSImage
  • Index(es):
    • Date
    • Thread