Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
16 user(s) are online (11 user(s) are browsing Forums)

Members: 1
Guests: 15

MickJT, more...

Support us!

Headlines

 
  Register To Post  

How extract truecolor image from an icon ?
Home away from home
Home away from home


See User information
I have in my code:

/* Iconification */
    
struct DiskObject *iconify NULL;

    
// reset icon X/Y positions so it iconifies properly on Workbench
    
if( (iconify=IIcon->GetIconTags("PROGDIR:DumbPad"ICONGETA_FailIfUnavailable,FALSETAG_END)) )
    {
     
iconify->do_CurrentX NO_ICON_POSITION;
     
iconify->do_CurrentY NO_ICON_POSITION;
    }


Which then i use as WINDOW_Icon, iconify. Now i want to use the same icon (in same ARGB format), to show up in the about window. Currently i do it like this:

// Create a Label object to wrap the icon image from DiskObject
                            
Object *labelImage NULL;
                            if (
iconify && iconify->do_Gadget.GadgetRender)
                            {
                                
labelImage IIntuition->NewObject(NULL"label.image",
                                    
LABEL_Imageiconify->do_Gadget.GadgetRender,
                                    
TAG_END);
                            }


And then just REQ_Image, labelImage. But then, it show me icon in 256 colors , which kind of expected because of do_Gadget.GadgetRender usage. Is there some easy and simple way to extract it from "iconify" so it will looks same true color one ? I mean something simple like some function with some tag or something ?

Thanks!

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How extract truecolor image from an icon ?
Just can't stay away
Just can't stay away


See User information
@kas1e

I use this code on one of my silly tools:
if(context)
 {
  
struct Node *n;
  
struct DiskObject *icon;
  
struct ExamineData *dat;

  
// Re-read theme drawer, but first "clean" listbrowser_list
  
IListBrowser->FreeListBrowserList(listbrowser_list);

  while( (
dat=IDOS->ExamineDir(context)) )
  {
   if( 
EXD_IS_FILE(dat) )
   {
    
IUtility->Strlcpy(pointer_fullnametheme_drawer_nameDMP_MAX_SRC);
    
IDOS->AddPart(pointer_fullnamedat->NameDMP_MAX_SRC);
    
pointer_fullname[IUtility->Strlen(pointer_fullname) - 5] = '\0'// remove '.info'
//DBUG("'%s'\n",pointer_fullname);
    
if( !(icon=IIcon->GetIconTags(pointer_fullname,
                              
ICONGETA_FailIfUnavailableTRUE
                              
ICONGETA_UseFriendBitMapTRUE,
                              
//ICONGETA_Width,IMG_W,
                              //ICONGETA_Height,IMG_H, 
                              //ICONGETA_ForceScaling, TRUE,
                              //ICONGETA_AllowUpscaling, TRUE,
                             
TAG_END)) ) break;

    if( (
n=IListBrowser->AllocListBrowserNode(TOT_COL,//TOTALCOLUMNS,
                                              
LBNA_Column,COL_IMG,
                                               
LBNCA_Image,icon->do_Gadget.GadgetRender,
                                               
//LBNCA_HorizJustify,LCJ_CENTER,
                                              
LBNA_Column,COL_TXT,
                                               
LBNCA_CopyText,TRUELBNCA_Text,dat->Name,
                                               
//LBNCA_HorizJustify,LCJ_CENTER,
                                             
TAG_DONE)) )
    {
     
IExec->AddTail(listbrowser_listn);
     ++
success;
//DBUG("%2ld)MOUSEPOINTER='%s' [0x%08lx]\n",success,dat->Name,n);
    
}
   }

  }


just change "listbrowser" stuff with your requester/gadget and see if icon shows full colors. Maybe just adding "ICONGETA_UseFriendBitMap, TRUE, " solves it.

Go to top
Re: How extract truecolor image from an icon ?
Home away from home
Home away from home


See User information
@javier
Quote:

ICONGETA_UseFriendBitMap, TRUE,

That one did the trick ! I simple create original icon with such a tag, and winOBJ take BOOPsi one with no probs as well. And for "about" there no needs for "label.gadget" usage, as boopsi image just can be placed into requester.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project