Re: CICN resource into NSImage, help!!!
Re: CICN resource into NSImage, help!!!
- Subject: Re: CICN resource into NSImage, help!!!
- From: Gore <email@hidden>
- Date: Tue, 14 May 2002 21:22:53 +0300
I'm now using this code:
- (NSImage *)iconImageforIcon:(int)icon
{
Handle theCIcon = NULL;
IconFamilyHandle iconFamily = (IconFamilyHandle)NewHandle(0);
OSErr theErr=noErr;
if ((theCIcon = GetResource('cicn',icon))==NULL) return nil;
NSLog(@"size=%d", GetHandleSize(theCIcon));
theErr = SetIconFamilyData(iconFamily, 'cicn', theCIcon);
NSLog(@"theErr=%d",theErr);
if (theErr != noErr) return nil;
return [[IconFamily iconFamilyWithIconFamilyHandle: iconFamily]
imageWithAllReps];
}
but it gives me error -180, but with other types such as ICN# it works,
what am i doing wrong? why is it so hard to do this?! if anyone know how
to set up an image rep for the 'cicn' resource then it would be nice...
Thanks,
Gore
On Tuesday, May 14, 2002, at 12:40 , Umed Zokirov wrote:
Gore,
Use
Carbon function SetIconFamilyData( )
It will convert from and to different icon formats
Umed
_______________________________________________
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.