summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2007-12-02 16:18:47 +0000
committerJason Rumney <jasonr@gnu.org>2007-12-02 16:18:47 +0000
commit44b1dc2e970d46690fba94b0ae726053198552ea (patch)
treeff11c92e0687b8625a968d0607a700ca56223edc /src
parent1a39318ad320b6c9dc9021a858711938a8a6105f (diff)
downloademacs-44b1dc2e970d46690fba94b0ae726053198552ea.tar.gz
(xbm_load) [WINDOWSNT]: Shuffle the bits of directly specified XBMs.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/image.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 90768f33c4c..002c442b376 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-02 Jason Rumney <jasonr@gnu.org>
+
+ * image.c (xbm_load) [WINDOWSNT]: Shuffle the bits of directly
+ specified XBMs.
+
2007-12-01 Richard Stallman <rms@gnu.org>
* xdisp.c (syms_of_xdisp) <scroll-conservatively>: Doc fix.
diff --git a/src/image.c b/src/image.c
index 28214642c3a..a92578862f0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -3120,6 +3120,8 @@ convert_mono_to_color_image (f, img, foreground, background)
release_frame_dc (f, hdc);
old_prev = SelectObject (old_img_dc, img->pixmap);
new_prev = SelectObject (new_img_dc, new_pixmap);
+ /* Windows convention for mono bitmaps is black = background,
+ white = foreground. */
SetTextColor (new_img_dc, background);
SetBkColor (new_img_dc, foreground);
@@ -3515,6 +3517,19 @@ xbm_load (f, img)
else
bits = XBOOL_VECTOR (data)->data;
+#ifdef WINDOWSNT
+ {
+ char *invertedBits;
+ int nbytes, i;
+ /* Windows mono bitmaps are reversed compared with X. */
+ invertedBits = bits;
+ nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
+ * img->height;
+ bits = (char *) alloca(nbytes);
+ for (i = 0; i < nbytes; i++)
+ bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]);
+ }
+#endif
/* Create the pixmap. */
Create_Pixmap_From_Bitmap_Data (f, img, bits,