View Single Post
Old 14 February 2018, 17:57   #2137
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 2,241
Quote:
Originally Posted by Akira View Post
... is it possible ... read a directory and for every .info file found, display the icon in an arbitrary way. I'm thinking of a Blitz Basic implementation.

I just want to know if it would be possible to display icons in other screens (any screen) as if they were any images!
Yes, that's possible. The details are all explained in the autodocs for icon.library v44+.

After once opening icon.library you could read in the icons with the function GetIconTagList(iconname, taglist) where one of your tags should be ICONGETA_Screen followed by a pointer to your screen structure. Icon.library then remaps the icon to your screen's palette by default (can also be disabled). An extended OS 3.5 DiskObject structure is returned.

In case you just need the planar images of this icon you can get them from the DiskObject structure under do_Gadget.GadgetRender and do_Gadget.SelectRender.

But if you prefer to use the 256 color OS 3.5 chunky images (not mapped to the screen) and the RGB palette then you can call IconControlA(DiskObject, taglist) with the tags ICONCTRLA_GetImage1/2, ICONCTRLA_GetPalette1/2, ICONCTRLA_GetImageMask1/2, ICONCTRLA_GetTransparentColor1/2 and other information. This method gives better quality on Hi/TrueColor screens by using cybergraphics.library and Read/WritePixelArray() (ReadPixelArray trashes dataregister 2 if you don't preserve it!).

Last edited by PeterK; 14 February 2018 at 18:09.
PeterK is offline  
 
Page generated in 0.04046 seconds with 11 queries