There was a thread on UtilityBase (I think) about how to display bitmap images that are embedded in the executable. Sadly, the site has been dead as a dodo for more than a year now.
What I'm after is this: I have a simple 16-colour image that I want to embed in the program and display in the GUI using ReAction. For certain specific reasons I don't want to use bitmap.image's BITMAP_SourceFile tag to load the image from disk, using datatypes. How would I best go about it? I have the image exported from PPaint as a field of UWORDs plus a corresponding struct Image, but how do I remap its colours for the screen the GUI opens on?
Tue, 2012-04-24 11:24
#1
Embedded images
Hi, yep "reusing" this old thread/topic.
I managed to create an image frrom an embedde data image:
...
But it stays always at left border/side, how can I "center" it.
TiA
Add a space.gadget object on both sides of the banner.
GA_RelWidth is not what you want. If this code works for you, then apparently it is ignored.
GA_RelWidth makes the gadget width relative to the window width. It is only useful with negative values. And it only makes sense if the gadget is added directly to an Intuition window, not to a layout gadget or a window.class object.
In order to scale the banner to a certain size, you should use the PDTM_SCALE method.
Yes, thx. Removed GA_RelWidth and it now it's centered.
BTW do I need to "DisposeDTObject()"?
Or does "DisposeObject( OBJ(OID_MAINWIN) );" dispose the datatype object too.
Both window.class and layout.gadget will automatically dispose their children added via WINDOW_Layout resp. LAYOUT_AddChild. So no, you don't need to manually dispose the datatype object. If you do, you will get a "memory freed twice" guru.
ok, thx for confirmation.
I tried to disposeDTobject(), got a crash/GR and. thx for explanation.