Just can't stay away
|
Thank you broadblues, I take several hours to try it with your advices. it doesn't work but with your code I can see if the icon is PNG or Amiga type... But it doesn't load some pictures on my MUI interfaces.
With the below code, for PNG icon , I obtain GetIconTags OK LayoutIcon OK IconControl OK PNG
for Glow Icon, GetIconTags OK LayoutIcon OK IconControl OK Amiga
Therefore, I think that the icons are well loaded but not displayed. it must be my call to the MUI ImageObject who must be wrong (at least, certainly many others wrong things in my code...)
Broadblues, if you have times, could you look at this ? But again, thanks to have send me this code.
Here is my code, :
struct DiskObject *ApplIcone;
struct Screen *monEcran ; if ((monEcran = LockPubScreen(NULL))) UnlockPubScreen(NULL,monEcran);
ApplIcone = GetIconTags("SysMon",ICONGETA_FailIfUnavailable,FALSE,TAG_DONE) ; /* or with SysMon.info */ //ApplIcone = GetIconTags(NULL,ICONGETA_GetDefaultName,"SysMon.info", ICONGETA_FailIfUnavailable,FALSE,TAG_DONE) ; /* GetIconTags failed like this or with "SysMon" */ if(ApplIcone) printf("GetIconTags OK\n"); else printf("GetIconTags KO\n");
//UBYTE *image = NULL; struct Image *image = NULL ; int w,h;
w = h = 0; BOOL rc ; rc = LayoutIcon(ApplIcone,monEcran,TAG_DONE); //rc = LayoutIcon(ApplIcone,NULL,TAG_DONE); /* or with this */ if (rc) printf("LayoutIcon OK\n"); else printf("LayoutIcon KO\n"); STRPTR * iconFormat;
if (IconControl(ApplIcone,ICONCTRLA_GetImageData1,&image, ICONCTRLA_GetWidth,&w, ICONCTRLA_GetHeight,&h, ICONCTRLA_GetIconFileFormat,&iconFormat, TAG_DONE)) printf("IconControl OK %s\n",iconFormat); else printf("IconControl KO\n");
And finally to load picture in my MUI interface :
Child, DtpicObject, MUIA_Dtpic_Name, image, End, /* or with (struct Image *)image */ Child, ImageObject, MUIA_Image_OldImage, image,End, /* or with (struct Image *)image */
... And at end : if (ApplIcone) { FreeDiskObject(ApplIcone); printf("FreeDiskObject final de l'icone\n") ; }
|