Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
76 user(s) are online (55 user(s) are browsing Forums)

Members: 1
Guests: 75

eliyahu, more...
Support us!
Recent OS4 Files
OS4Depot.net





Icon to BitMap
Just popping in
Joined:
2015/9/28 23:42
From Bettendorf, IA, USA
Posts: 62
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.


   Report Go to top

Re: Icon to BitMap
Not too shy to talk
Joined:
2006/11/26 17:45
Posts: 262

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.


   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project