BitMapClass and Icon (pointer icons) in a ListBrowser

4 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
BitMapClass and Icon (pointer icons) in a ListBrowser

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

  1. Object *imagen1;
  2. struct DiskObject *icon;
  3. struct BitMap *bm1 = NULL;
  4. struct Screen *scr;
  5. ...
  6. icon = IIcon->GetDiskObject(icon_filename);
  7.  
  8. IIcon->IconControl(icon,
  9. ICONCTRLA_GetScreen,&scr,
  10. ICONCTRLA_GetBitMap1,&bm1, TAG_DONE);
  11.  
  12. imagen1 = IIntuition->NewObject(BitMapClass, NULL,
  13. BITMAP_Screen, scr,
  14. BITMAP_BitMap, bm1,
  15. BITMAP_Width,IMG_W, BITMAP_Height,IMG_H, TAG_END);
  16.  
  17. if( (n=IListBrowser->AllocListBrowserNode(TOTALCOLUMNS,
  18. LBNA_Column,0, LBNCA_CopyText,TRUE,
  19. LBNCA_Text,dat->Name,
  20. LBNA_Column,1, LBNCA_HorizJustify,LCJ_CENTER,
  21. LBNCA_Image,imagen1,
  22. TAG_DONE)) ) {
  23. ...

BTW icon_filename is one of the mason-mouse-pointers (32bits icons IIRC)

zzd10h
zzd10h's picture
Offline
Last seen: 7 years 1 month ago
Joined: 2012-08-24 20:56
Re: BitMapClass and Icon (pointer icons) in a ListBrowser

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,

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 2013-05-30 00:53
Re: BitMapClass and Icon (pointer icons) in a ListBrowser

YES!!! works fine zillion THX

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

zzd10h
zzd10h's picture
Offline
Last seen: 7 years 1 month ago
Joined: 2012-08-24 20:56
Re: BitMapClass and Icon (pointer icons) in a ListBrowser

Hourrah :)

Log in or register to post comments