[App][2010.11.10] Png2Exe - Creates an exe file with an embedded image as icon.

Search This thread

dubidu

Senior Member
Apr 19, 2006
210
168
UK
Thanks you !!!!! but, can you support script ? (MortScript) ;)

I must admit, I've never use MortScripts to do anything, I prefer a shiny new exe 8).
How do you ran them? If its a matter of just passing the script to the mortscript exe, you should be able to do it specifying mortscript runer as exe and the script as argument.

I "could" find a way to put the script inside the new exe, so it will hold both icon and script, but even if it looks "cleaner" (just one exe file and the mortscript runtime), it will stop the nice thing about scripting which is to be able to access/tweak the code directly. Once it is inside the exe, no changing back :)
 

j0ntown

Member
Jul 24, 2009
41
1
64 by 64 must?

First, bravo and thanks!

Writing in contxt of use with Host 1.0 ... can we go with icons custom sized? 64x64 is fine for 99.99 of scrolling around - it's just that his tiles are 90 by 92.
 

dubidu

Senior Member
Apr 19, 2006
210
168
UK
First, bravo and thanks!

Writing in contxt of use with Host 1.0 ... can we go with icons custom sized? 64x64 is fine for 99.99 of scrolling around - it's just that his tiles are 90 by 92.

:)

It's not a "must", I can try to give the option of more sizes, but it's kind of tricky.
Windows Mobile doesn't have any API to convert to ICON, so I had to manually write the icon data (header, mask, data bits, etc), I originally did it with a 32x32 (see the Link2CPL tool) but found the icons where too small for my HD2. I switched to 64x64 (adjusting the header and data bits) so they look better with more detail.
One tricky part was the icon, the other was to "embedded" into the exe, again there is no functionality on .NET or Windows API to create resources inside a library. so the way I did it was to create a unmanaged exe with a 64x64 icon, and then replace the icon data inside.
I can try having different exes (let's say, one for 32, 64, 90, etc) and give that option, that should work, just need to redo the header and embedding code.

Does Host 1.0 resize the icons?, most apps do when they find a different size icon.
 

seimu

Member
Dec 26, 2009
38
39
Hi, great application but I have a problem. Here's a pic ...

Any solution? Thx.
 

Attachments

  • ScreenShot1.jpg
    ScreenShot1.jpg
    43.7 KB · Views: 72

dubidu

Senior Member
Apr 19, 2006
210
168
UK
I'm sorry, I forgot...here is.

All icons are good.

The 64x64 icons that the PNG2EXE generates are 256 colors only, I have to pick one color to be the transparent one, basically the mask is created with a 64x64 black( the first entry in the palette table).

Those two images use that first entry for the black color, also both are more than 256 colors, and when Windows renders those into the picturebox, some of the blacks gets converted to the 0 entry, which then is converted as the transparent color.

Just try changing the color of the first entry, if the RGB values are different, Windows will not set those pixel to the 0 entry.

Look at the attached picture, I changed the first entry in the palette from 0/0/0 to 20/0/0 which results in a proper icon
 

seimu

Member
Dec 26, 2009
38
39
OK, thank you very much for the quick reply and help.

Great application. thanks
 

tito12

Senior Member
Feb 15, 2008
1,541
81
Tel Aviv
I must admit, I've never use MortScripts to do anything, I prefer a shiny new exe 8).
How do you ran them? If its a matter of just passing the script to the mortscript exe, you should be able to do it specifying mortscript runer as exe and the script as argument.

Hi dubidu

I can't find the way to make it run this way:
I have Mortscript.exe and the the Settings.mscr(the script I want to execute) in the same folder but I always get the message "settings was not found". I think I tried all the syntaxes possible with no result. Do you have an idea why?
Thanks in advance

EDIT:

I found the solution, it's that Mortscript doesn't handle arguments in directories with spaces in their name (like Program Files), so by moving the script to the device root everything went fine :)
 
Last edited:

mrvearn

Senior Member
Jan 8, 2010
117
14
KL
Hi dubidu,
I thought after replace/change the icon everything will be fine....now i'm realise that i need to put arguments to run the "new" .exe... 2 question...
- how to put arguments? any example? (sorry...i'm totally noobs)
- let say, i'm changing / replace 1 icon (exe) in setting - example : ClearStorage.exe, the new .exe will be _ClearStorage.exe. how to 'replace' new .exe with old exe?
hope you can understand what i'm trying to say (i'm sorry, english not my native language) you have nice app here.