Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
115 user(s) are online (110 user(s) are browsing Forums)

Members: 0
Guests: 115

more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Hi,
I've 2 questions about MUI and the use of picture inside a program.
If somebody could answer me, it will be very nice.

1) I'm trying to use a Glow icon as source of a DTPic picture in a program but it fails to show.

For example, in the program SysMon (on OS4depot) I'm trying to replace the png info file source of the main panel (at the top left) by a glow icon info file.
With PNG it works well like this

#define DtpicObject MUI_NewObject(MUIC_Dtpic
#define MUIA_Dtpic_Name 0x80423d72
Child, DtpicObject, MUIA_Dtpic_Name, "PROGDIR:SysMon.info", End,

But if I replace the SysMon.info PNG file by a SysMon.info Glow icon file, the picture is no more showed.

But in the AboutBox (AboutBox MUI class) the glow icon is well showed !

Is it possible to add a Glow icon as DTPic source ?
(I don't know what is exactly a glow icons, I use one of cha05e90, thanks :))

Or is it possible with another MUI class to use a glow icon .info file as source ?

2) In the MCC NList_Demo.c source,
the embedded pictures are described like this

const UBYTE list2_body[156] = {
0x04,0x00,0x04,0x00,0x78,0x00,0x08,0x00,0x30,0x00,0x08,0x00,0x79,0x00,0x02,
...
...
0x00,0x00,0x00,0x00,0x00,0x00, };

Do you know how to transform a normal picture like this ? Is a tool available ?
I would like to add some pictures in my NLists.

Thank by advance, for your replys.
Kinds regards
Guillaume


Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
Do you have an icon datatype installed? If not then i expect that it wouldn't work.

That's assuming that MUI loads images in a similar way to Reaction, via datatypes.

You can load images from icons, but you need to load the icon as a diskobject.


Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank Broadblues for your advice.

I still use GetDiskObject to load the iconified icon like this
MUIA_Application_DiskObject, ApplIcone = GetDiskObject("PROGDIR:SysMon"),

therefore I tried

Child, DtpicObject, MUIA_Dtpic_Name, ApplIcone, End,

with ApplIcone = GetDiskObject("PROGDIR:SysMon"),
or
ApplIcone = GetDiskObject("PROGDIR:SysMon.info"),

but picture is no showed :(

With PNG icon it works well, therefore I think that icon datatype is working, no ?

Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
@zzd10h

Quote:

1) I'm trying to use a Glow icon as source of a DTPic picture in a program but it fails to show.


In that case you will need something like this:
http://os4depot.net/index.php?functio ... datatype/icon/info_dt.lha

Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
Quote:

With PNG icon it works well, therefore I think that icon datatype is working, no ?


A PNG icon is a PNG so will be loaded by the png.datatype


Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank will try and post result

Go to top
Re: Use of Glow icon as Picture in a MUI program
Quite a regular
Quite a regular


See User information
@broadblues

As zzd10h already stated, the About-MUI.class is able to load the 32Bit-GlowIcon without any help of a datatype!
I *assume* the author of that MUI class uses icon. or workbench.library functions to load the icon imagery...

X1000|II/G4|440ep|2000/060|2000/040|1000
Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
Quote:

As zzd10h already stated, the About-MUI.class is able to load the 32Bit-GlowIcon without any help of a datatype!
I *assume* the author of that MUI class uses icon. or workbench.library functions to load the icon imagery...


Yes I saw that and make sense, but unless I misunderstood, it's not the about window that has a problem (I think he said that works) but another image he is trying to replace?




Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
Okay I did a test.

I downloaded sysmon.

Replaced the PNG icon

Fist with a ILBM

The image loadaed fine

Then with a true icon (.info)

The image didn't load (the about window still worked)

Then I installed the icon datatype.

After that the image loaded fine.


Therefore MUI does use datatypes.library to load images (which I think was ano brainer but you never know)

I don't think the solution is to install the info datatype though, as it;s not currently a standard datatype and I'm sure most people don't have it. rather you should tobtain he 32bit image data via icon library, and pass that to the MUI image class. I don't how to do that (pass the image data to MUI), but as most NUI fans claimm MUI is easier to use than ReAction it must be trivial



Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank broadblues, very nice to you to have made the test :)

Or a simpler solution will be, maybe, to translate this icon in a embedded image structure ?

For my 2) question, do you have some idea? How to transform a picture to be included in the source code ?

Sorry to ask so much things...

Go to top
Re: Use of Glow icon as Picture in a MUI program
Quite a regular
Quite a regular


See User information

X1000|II/G4|440ep|2000/060|2000/040|1000
Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank
i will try bin2c tool :)

Go to top
Re: Use of Glow icon as Picture in a MUI program
Just popping in
Just popping in


See User information
Oups sorry

Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Sinisrus,
why are you sorry ? (je t'ai envoyé un mail)


Edited by zzd10h on 2012/11/1 19:58:25
Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
@zzd10h

Yeah i think you should use the info.datatype for that, i just remember a few programs from kas1e when we had exactly the same issue on the various aboutbox (no image at all) so the image was not showed.

Only problem, this datatype isn't availible on OS4 by default

Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
No don't embed a hardcoded image
do something like

icon = m_IIcon->GetIconTags(NULL,ICONGETA_GetDefaultName,pointer_names[i],ICONGETA_FailIfUnavailable,TRUE,TAG_DONE))

UBYTE *image = NULL;
int w,h;

w = h = 0;
m_IIcon->LayoutIcon(m_pointer_icons[i],m_screen,TAG_DONE);
m_IIcon->IconControl(m_pointer_icons[i],ICONCTRLA_GetImageData1,&image,
ICONCTRLA_GetWidth,&w,
ICONCTRLA_GetHeight,&h,
TAG_DONE);

then feed image to you above code.


Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank you broadblues,
I take several hours to try it with your advices.
it doesn't work but with your code I can see if the icon is PNG or Amiga type...
But it doesn't load some pictures on my MUI interfaces.

With the below code,
for PNG icon , I obtain
GetIconTags OK
LayoutIcon OK
IconControl OK PNG

for Glow Icon,
GetIconTags OK
LayoutIcon OK
IconControl OK Amiga

Therefore, I think that the icons are well loaded but not displayed. it must be my call to the MUI ImageObject who must be wrong (at least, certainly many others wrong things in my code...)

Broadblues, if you have times, could you look at this ?
But again, thanks to have send me this code.

Here is my code, :

struct DiskObject *ApplIcone;

struct Screen *monEcran ;
if ((monEcran = LockPubScreen(NULL)))
UnlockPubScreen(NULL,monEcran);


ApplIcone = GetIconTags("SysMon",ICONGETA_FailIfUnavailable,FALSE,TAG_DONE) ; /* or with SysMon.info */
//ApplIcone = GetIconTags(NULL,ICONGETA_GetDefaultName,"SysMon.info", ICONGETA_FailIfUnavailable,FALSE,TAG_DONE) ; /* GetIconTags failed like this or with "SysMon" */
if(ApplIcone)
printf("GetIconTags OK\n");
else
printf("GetIconTags KO\n");

//UBYTE *image = NULL;
struct Image *image = NULL ;
int w,h;

w = h = 0;
BOOL rc ;
rc = LayoutIcon(ApplIcone,monEcran,TAG_DONE);
//rc = LayoutIcon(ApplIcone,NULL,TAG_DONE); /* or with this */
if (rc)
printf("LayoutIcon OK\n");
else
printf("LayoutIcon KO\n");

STRPTR * iconFormat;

if (IconControl(ApplIcone,ICONCTRLA_GetImageData1,&image,
ICONCTRLA_GetWidth,&w,
ICONCTRLA_GetHeight,&h,
ICONCTRLA_GetIconFileFormat,&iconFormat,
TAG_DONE))
printf("IconControl OK %s\n",iconFormat);
else
printf("IconControl KO\n");

And finally to load picture in my MUI interface :

Child, DtpicObject, MUIA_Dtpic_Name, image, End, /* or with (struct Image *)image */
Child, ImageObject, MUIA_Image_OldImage, image,End, /* or with (struct Image *)image */

...
And at end :
if (ApplIcone)
{
FreeDiskObject(ApplIcone);
printf("FreeDiskObject final de l'icone\n") ;
}



Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
I'm a ReAction guy so your not asking the right person but I would take a punt at MUI_Pixmap where you have tried ImageObject or DtpicObject above

tags along the lines of:

MUIA_Pixmap_Height,h,
MUIA_Pixmap_Width,w,
MUIA_Pixmap_Format, MUIV_Pixmap_Format_ARGB32
MUIA_Pixmap_Data,image

tag order may or may not be critical

Go to top
Re: Use of Glow icon as Picture in a MUI program
Just can't stay away
Just can't stay away


See User information
Thank Broadblues,
but I don't find any references to this MUI_Pixmap class (or MUIA_Pixmap parameters) neither on the SDK noor by googling it.

I will try to ask to the AboutBox authors which object is in use in his class.

Thank


Go to top
Re: Use of Glow icon as Picture in a MUI program
Home away from home
Home away from home


See User information
Oh. That could be a beta component then.

Sorry, not sure how you would do it with public classes.

Where are all the MUI experts when you need them??


Go to top

  Register To Post
(1) 2 »

 




Currently Active Users Viewing This Thread: 3 ( 0 members and 3 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project