• 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: CICN resource into NSImage, help!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: CICN resource into NSImage, help!!!
      • From: Nathan Day <email@hidden>
  • Prev by Date: Re: Application Dock Menu little issue II (attack of the Dock)
  • Next by Date: Re: Application Dock Menu little issue II (attack of the Dock)
  • Previous by thread: CICN resource into NSImage, help!!!
  • Next by thread: Re: CICN resource into NSImage, help!!!
  • Index(es):
    • Date
    • Thread