Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
92 user(s) are online (88 user(s) are browsing Forums)

Members: 0
Guests: 92

more...

Support us!

Headlines

 
  Register To Post  

Icon to BitMap
Just popping in
Just popping in


See User information
How do I get an icon's render image copied to a bitmap?

struct DiskObject *icon NULL;
icon IIcon->GetIconTags(NoInfoBuffer,
    
ICONGETA_FailIfUnavailableTRUE,
    
ICONGETA_UseFriendBitMapTRUE,
    
ICONGETA_ScreenPID->Screen,
TAG_END);

PID->OrigWidth=64;   // get the icon's dimensions
PID->OrigHeight=64;  // not use these defaults

if (!(PID->OrigBM=IGraphics->AllocBitMapTags(PID->OrigWidth,PID->OrigHeight,32,
    
BMATags_PixelFormatPIXF_A8R8G8B8,
    
BMATags_ClearTRUE,
    
BMATags_DisplayableTRUE,
TAG_DONE)))
{
// error
}


How do I get the icon->do_Gadget.GadgetRender copied to the PID->OrigBM? I always end up with a solid grey block.

I want to use a bitmap because down the road there could be some scaling (I know it can be done above in loading).

And I want no border/text.


Go to top
Re: Icon to BitMap
Not too shy to talk
Not too shy to talk


See User information

do_Gadget.GadgetRender has no meaning on OS4, it only contains some kind of legacy image for compatibility with old programs.

You can use IconControl to read the pixel data of the real image.

Or just use DrawIconState to render the icon into the bitmap.


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