diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/xbm-images.html | |
new repository
Diffstat (limited to 'devdocs/elisp/xbm-images.html')
| -rw-r--r-- | devdocs/elisp/xbm-images.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/devdocs/elisp/xbm-images.html b/devdocs/elisp/xbm-images.html new file mode 100644 index 00000000..6941cb71 --- /dev/null +++ b/devdocs/elisp/xbm-images.html @@ -0,0 +1,13 @@ + <h4 class="subsection">XBM Images</h4> <p>To use XBM format, specify <code>xbm</code> as the image type. This image format doesn’t require an external library, so images of this type are always supported. </p> <p>Additional image properties supported for the <code>xbm</code> image type are: </p> <dl compact> <dt><code>:foreground <var>foreground</var></code></dt> <dd> +<p>The value, <var>foreground</var>, should be a string specifying the image foreground color, or <code>nil</code> for the default color. This color is used for each pixel in the XBM that is 1. The default is the frame’s foreground color. </p> </dd> <dt><code>:background <var>background</var></code></dt> <dd><p>The value, <var>background</var>, should be a string specifying the image background color, or <code>nil</code> for the default color. This color is used for each pixel in the XBM that is 0. The default is the frame’s background color. </p></dd> </dl> <p>If you specify an XBM image using data within Emacs instead of an external file, use the following three properties: </p> <dl compact> <dt><code>:data <var>data</var></code></dt> <dd> +<p>The value, <var>data</var>, specifies the contents of the image. There are three formats you can use for <var>data</var>: </p> <ul> <li> A vector of strings or bool-vectors, each specifying one line of the image. Do specify <code>:height</code> and <code>:width</code>. </li> +<li> A string containing the same byte sequence as an XBM file would contain. You must not specify <code>:height</code> and <code>:width</code> in this case, because omitting them is what indicates the data has the format of an XBM file. The file contents specify the height and width of the image. </li> +<li> A string or a bool-vector containing the bits of the image (plus perhaps some extra bits at the end that will not be used). It should contain at least <code><var>stride</var> * <var>height</var></code> bits, where <var>stride</var> is the smallest multiple of 8 greater than or equal to the width of the image. In this case, you should specify <code>:height</code>, <code>:width</code> and <code>:stride</code>, both to indicate that the string contains just the bits rather than a whole XBM file, and to specify the size of the image. </li> +</ul> </dd> <dt><code>:width <var>width</var></code></dt> <dd> +<p>The value, <var>width</var>, specifies the width of the image, in pixels. </p> </dd> <dt><code>:height <var>height</var></code></dt> <dd> +<p>The value, <var>height</var>, specifies the height of the image, in pixels. </p> <p>Note that <code>:width</code> and <code>:height</code> can only be used if passing in data that doesn’t specify the width and height (e.g., a string or a vector containing the bits of the image). <acronym>XBM</acronym> files usually specify this themselves, and it’s an error to use these two properties on these files. Also note that <code>:width</code> and <code>:height</code> are used by most other image formats to specify what the displayed image is supposed to be, which usually means performing some sort of scaling. This isn’t supported for <acronym>XBM</acronym> images. </p> </dd> <dt><code>:stride <var>stride</var></code></dt> <dd><p>The number of bool vector entries stored for each row; the smallest multiple of 8 greater than or equal to <var>width</var>. </p></dd> </dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/XBM-Images.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/XBM-Images.html</a> + </p> +</div> |
