Page 1 of 1

How do I change or set the variable name while generating a XPM file

Posted: 2017-11-24T11:37:14-07:00
by Joel
Hi:

I'm using IM to convert BMP to XPM, but I'd like to able to set the variable string something like:

Code: Select all

const char* folder_xpm[xxx] // the rest of the string
As you can see I only need to add const and prepend _xpm. Right now I have to open the file and edit it my self,any ideas?

Re: How do I change or set the variable name while generating a XPM file

Posted: 2017-11-26T09:43:58-07:00
by Jason S
As of v7.0.7-11, the pattern "static char *...[] = {" is hardcoded, and cannot be changed. The "..." is the "base output filename", and I don't see any way to set it independently.

There must be many ways to automate the editing that you say you're doing manually. In a Unix-like environment, you could use "sed".

If you're #including the XPM file in a C/C++ program (and why else would you use XPM?), maybe you could even do it with some horrible preprocessor hack, like:

Code: Select all

const
#define folder folder_xpm
#include "folder.xpm"
#undef folder