Hi, I just try to show an icon on a listbrowser and I get the icon but seems depth+palette are wrong. It look like I'm missing som tags to set/get so icon/bitmap looks fine in listbrowser.
How do I set icon's depth+palette values so it shows ok in listbrowser?
TIA
Object *imagen1; struct DiskObject *icon; struct BitMap *bm1 = NULL; struct Screen *scr; ... icon = IIcon->GetDiskObject(icon_filename); IIcon->IconControl(icon, ICONCTRLA_GetScreen,&scr, ICONCTRLA_GetBitMap1,&bm1, TAG_DONE); imagen1 = IIntuition->NewObject(BitMapClass, NULL, BITMAP_Screen, scr, BITMAP_BitMap, bm1, BITMAP_Width,IMG_W, BITMAP_Height,IMG_H, TAG_END); if( (n=IListBrowser->AllocListBrowserNode(TOTALCOLUMNS, LBNA_Column,0, LBNCA_CopyText,TRUE, LBNCA_Text,dat->Name, LBNA_Column,1, LBNCA_HorizJustify,LCJ_CENTER, LBNCA_Image,imagen1, TAG_DONE)) ) { ...
BTW icon_filename is one of the mason-mouse-pointers (32bits icons IIRC)
Maybe that you could try this (it works for me to add icon to a button gadget) ?
struct DiskObject *icon;
icon = GetIconTags(icon_filename,
ICONGETA_FailIfUnavailable, FALSE,
ICONGETA_UseFriendBitMap, TRUE,
ICONGETA_Width,IMG_W,
ICONGETA_Height,IMG_H,
ICONGETA_ForceScaling, TRUE,
ICONGETA_AllowUpscaling, TRUE,
TAG_END ) ;
LBNCA_Image,icon->do_Gadget.GadgetRender,
YES!!! works fine zillion THX
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
Hourrah :)