Saving icon with PutIconTags

3 posts / 0 new
Last post
jap
jap's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 2011-06-04 05:53
Saving icon with PutIconTags

Hello,

I'm having trouble with writing an icon with PutIconTags(). What I'm trying to do is to read the properties of two icon files (image, icon type, default tool, etc.) and save an icon that is a combination of the two icons.

My program reads the two icon files first with GetDiskObject(). Then it creates a blank icon with NewDiskObject() and sets the blank icon's struct DiskObject data members.

When the "blank icon" is saved with PutIconTags(), all the properties are correct in the saved icon file except the icon image. For some reason PutIconTags() saves a 4 color "Old Image" only.

How can I make it save a full color image?

OldFart
OldFart's picture
Offline
Last seen: 1 hour 16 min ago
Joined: 2010-11-30 14:09
Re: Saving icon with PutIconTags

@Jap

Maybe this will help you out? From what I remember when I first created this code, I suffered from simmilar issues, so...

  1. if ((xn->xn_Icon = IIcon->DupDiskObject(xn->xn_DiskObject, ICONDUPA_DuplicateDrawerData , FALSE
  2. , ICONDUPA_DuplicateImageData , TRUE
  3. , ICONDUPA_DuplicateImages , TRUE
  4. , ICONDUPA_DuplicateToolWindow , FALSE
  5. , ICONDUPA_DuplicateToolTypes , FALSE
  6. , ICONDUPA_DuplicateDefaultTool, FALSE
  7.  
  8. , ICONDUPA_ActivateImageData , TRUE
  9.  
  10. , ICONA_ErrorCode , &(__GE)->ge_ErrorCode
  11. , TAG_END)) != NULL)

Especially the 'Image'-related tags are of any interest.

OldFart

jap
jap's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 2011-06-04 05:53
Re: Saving icon with PutIconTags

DupDiskObject() solved the problem, thanks!

Log in or register to post comments