[SOLVED] Using Filler and BitMap gadgets
Posted: Tue Dec 04, 2012 11:35 am
I'm trying to use Filler and BitMap gadgets in a new little soft I'm currently developing but I encountered the following problems/questions:
- I'm trying to display a banner in the upper part of my GUI. Browsing the Autodocs I found the Filler gadget was quite adapted for this (according to its autodocs self definition). Unfortunately I can't make it to display anything, for now I've given it a gadget id (GA_Id), a screen pointer (FILLER_Screen) and a source filename (FILLER_ImageFilename). Any idea? Is Filler_ic adapted for the job? Solved -> Use LAYOUT_AddImage instead of LAYOUT_AddGadget.
- Now I'm trying to display a thumbnail of an on-disk picture, this picture data will *not* be loaded from datatypes (don't ask why, I need to load them by myself), in order to scale my original image to the gadget I need to retrieve the gadget's size. AFAIU IA_Width/IA_Height are the bitmap data size, how can I know the size of the gadget itself, GA_Width/GA_Height does not seem to work for me? Is BitMap_ic the right classe to use? Solved -> Use a readonly button and attach the bitmap to it.
- I'm willing to allow the user to influence the size of the thumbnail by using a LAYOUT_WeightBar. How can I detect an action on this bar and regenerate my new thumbnail? Solved -> To do this there is no other solution than subclassing gadget class and doing everything by hand. I.e. scaling the thumbnail on the render message reception.
- Which method would you advise me to obtain a BitMap from my in memory (self loaded) RGB values: BltBitMapTagList() seems good if I can guarantee 24 or 32bits RGB values, what about p96WritePixelArray ? Even if for now I trying to convert to a BitMap struct because of the BitMap_ic I'm using, I will need this conversion at some point, so even if using BitMap_ic isn't the right solution for the thumbnail this question remains. Solved -> BltBitMapTagList() does the job quite well, but there input data format are limited (LUT, RGB24 or ARGB32)