Re: Convert PICT to NSImage
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