I'm trying to initialize a DiskObject structure by hand. I have called NewDiskObject to get an empty object, which is fine, and now I want to set up the Gadget structure with two images, for which data I have somewhere else in memory (that is the reason for doing it by hand: My Image data is in memory and not on disk).
Problem is, when I specify an Image Depth of more than 8, AmiDock just shows some random default image instead of my image in ram. I have tested with GetIconTags, and here the Depth values are all 8, but that doesn't make sense, since the icon shown is 32-bit (at least that's what I think it is).
Comments?
@alfkil
The Gadget structure and it's associated struct Image pointers is only for legacy planar icon gfx. For 8-bit CLUT or 32-bit ARGB icon gfx you should use IconControl():
@salass00
Thanks for the tip. I can't get it working, though. AmiDock still just shows some default image.
Here's ma code:
And this:
IconControl returns 5, so everything should be in order...
Apparently one needs to call LayoutIcon to make the changes happen. Strange, because the autodoc says:
"Useful only for palette mapped icons"
...and I am using direct mapped icons. Well...
"palette mapped" in this context refers to all images that are stored seperately to those in do_Gadget->GadgetRender and do_Gadget->SelectRender. In OS 3.5 (when this autodoc was written) there existed only normal images and palette mapped images.
Ok, so far so good, icons are working. But now I need to supply a struct Image to the AppDocky context menu. Do I really need to create a DiskObject for that, or is there some smart method to create a 32-bit struct Image??
Well a struct Image stands alone in memory for display images so no is not part of a DiskObject. Even if a DiskObject makes use of an Image.
What funtion is it? Can the bitmap class help?
Well, I have made the code, so that IconControl() creates the struct Image for me in full 32--bit. It works, but it is a hell of a detour for such a simple purpose...
I need the struct Image to supply to NewObject("popmenuitem.class"..... PMIA_Icon,... TAG_DONE); There doesn't seem to be a tag for a bitmap class, and there doesn't seem to be any references to struct Image in the bitmap class.
@alfkil
The BOOPSI/ReAction BitMap class is a sub-class of imageclass, so a bitmap object in fact points to a struct Image. If you create the bitmap image object
Object *bitMapImage = NewObject(...);
you'll then probably need to typecast
PMIA_Icon, (struct Image *)bitMapImage, ...
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
@trixie
An overdue thanks for your explanation :)
Glad I could help.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2