VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I'm trying to use a custom icon in my DOSBox builds, and want to replace the icon in dosbox_logo.h, which defines the icon that appears at the upper left of the title bar.

@ykhwong posted a very nice version of a "Z:" icon in another thread, in the correct format for dosbox_logo.h. And I think I see how I could create the code for my own icon, but I can only see how to create it by hand, by typing in the correct number for every pixel.

Is there a way to generate those numbers automatically, without doing typing in the code for every pixel by hand? If so, could someone kindly explain how this might be done?

Thanks for your help.

Reply 2 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you - that pointed me to plenty of code that does the job. As far as I can see, there's no prebuilt application that does it.

Reply 3 of 14, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Yes there are prebuilt binaries...for Linux, as far as I recall.
For example png2c.

Reply 4 of 14, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

Use this to convert your icon to PPM (32bit array).
http://netpbm.sourceforge.net/doc/ppm.html

If you get something like this:

P3 
# temp.ppm
4 4
15
1 7 2 15 1 15 0 0 0 15 0 15
0 3 0 3 1 7 0 0 0 0 0 0
0 1 7 0 0 0 0 3 7 0 3 0

Remove lines from P3 to 15 and add a zero after 3 numbers and add "," in between.

1, 7, 2, 0, 15, 1, 15, 0, 0, 0, 0, 0, 15, 0, 15, 0,...

Reply 5 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I will try that. Thank you!

Reply 6 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

that is what I do more or less as well.

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

There are also tools for Windows just don't know anymore where to find. I did some firefox customization some years ago and for that you needed to convert the pictures as well...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 8 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you again. If anyone finds the Windows tool, I would be grateful.

It looks as if it should be easy to automate the procedure of adding the zeros and the commas. A macro in a good text editor or a word-processor should do it. I'll experiment and report.

Reply 9 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You can probably find a windows binary of png2c, or you can compile it yourself (since you are compiling dosbox yourself you should be able to)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 14, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

1. Copy the contents of PPM to notepad or MS word. (Like mentioned above, remove four lines of header in advance)
2. Press Ctrl-H and replace space(" ") to tab(^t).
3. Copy all again to MS Excel.
4. Insert cells after 3 columns so that D, H, L, P will have empty rows.
5. Fill rows of D, H, L, P columns with 0.
6. Copy everything to notepad
7. Press Ctrl-H and replace the existing tabs to ", " (comma space)

[EDIT] This is not an automation but it could be better than manually adding 0 and comma.

Reply 11 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I've found a free Windows program that can create ascii-format PPM files to be used for the dosbox_logo.h file (after following @yhkwong's procedure):

http://www.xnview.com/

I've had complete success with @ykhwong's procedure. Thank you!

Reply 12 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I've been trying to create a new dosbox_logo.h, and the current version of the tools I used before don't seem to work any longer.

Xnview now produces a long single string of digits, not the twelve-column rows that ykhwong describes above.

I found this:

http://sourceforge.net/projects/png2cscc/?source=dlp

But it outputs lines with 16 hex numbers, not 12 dec numbers.

I suppose I can convert all this to the right format, but I wonder if anyone knows of a Windows or OS X-based tool that will create the kind of 12-number rows that ykhwong describes, and which I used to be able to create easily from third-party tools.

Reply 13 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Found the answer:

http://gnuwin32.sourceforge.net/packages/netpbm.htm

The executable bmptoppm.exe produces a file that's close enough to what I was looking for, with the command:

bmptoppm.exe -plain d:\path\bmpfile.bmp > d:\path\output.ppm

You end up with some lines of different lengths, but it's not hard to sort this out in Excel.

One addition to ykhwong's instructions: after step 7, also replace the paragraph breaks with comma-space-paragraphbreak or the resulting output won't work.