Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bitmap -data and -file ?

24 views
Skip to first unread message

adilseb...@gmail.com

unread,
Jan 4, 2018, 6:59:19 AM1/4/18
to
Please can someone explains what is the differences between "-data" and "-file" options when creating a bitmap image?, and what is "bitmap program"?

Rich

unread,
Jan 4, 2018, 7:23:20 AM1/4/18
to
Indicating if you have read the manual page would be a good idea, as
the pair are quite clearly defined there:

-data string
Specifies the contents of the source bitmap as a string.
The string must adhere to X11 bitmap format (e.g., as
generated by the bitmap program). If both the -data and
-file options are specified, the -data option takes
precedence.

-file name
name gives the name of a file whose contents define the
source bitmap. The file must adhere to X11 bitmap format
(e.g., as generated by the bitmap program).


"bitmap program" refers to a program distributed with the X11 window
system that handles "bitmap" format data. The name of the program is
"bitmap".

"man bitmap" on a Linux/Unix system with the man page installed would
give documentation on the bitmap program.

adilseb...@gmail.com

unread,
Jan 4, 2018, 7:56:07 AM1/4/18
to
I read the manual but with no exemple I wasn't able to understand the difference between them, I think I have just to specify the image's path in "-file", so what is the utility of "-data" option?

Thanks

Gerald Lester

unread,
Jan 4, 2018, 11:36:31 AM1/4/18
to
On 01/04/2018 06:56 AM, adilseb...@gmail.com wrote:
> I read the manual but with no exemple I wasn't able to understand the difference between them, I think I have just to specify the image's path in "-file", so what is the utility of "-data" option?

If you have the bitmap or image in its own "native" data format file,
then use -file.

You use -data when you want take that file and "embedded" the (suitably
coded) contents in the file with your Tcl program. Some people do this
to make distribution easier.


--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

adilseb...@gmail.com

unread,
Jan 4, 2018, 12:57:42 PM1/4/18
to
For "-data" option it will be better if its description is like:
Specifies a string whose contents define the source bitmap.

Rich

unread,
Jan 4, 2018, 1:02:52 PM1/4/18
to
Why is an example necessary given the clarity of the manual
description. The first sentence of both sections fully defines the
meaning:

-data string
Specifies the contents of the source bitmap as a string.

-file name
name gives the name of a file whose contents define the
source bitmap.

-data is used when you already have the bitmap image contents in a string.

-file is used when the bitmap image contents are stored in a file on
the filesystem.

The utility of the -data option is you can specify a static string such
that the image content is actually part of the source code of the
program, so no external storage files for the images are necessary in
this instance.

Or, presuming you wanted to create the bitmap source data at runtime,
you could generate an approprate string, then use the -data option to
consume the string and display the resulting image. So no need then to
spit the data out to a temporary file to reread it back in via the
-file option.



adilseb...@gmail.com

unread,
Jan 4, 2018, 1:23:35 PM1/4/18
to
I am very gratefull for your explanation, thank you very much
0 new messages