Author: spouliot
Date: 2006-08-27 22:25:36 -0400 (Sun, 27 Aug 2006)
New Revision: 64457

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/bitmap.c
Log:
        * bitmap.c: Fix endianess issues in locked bitmap.


Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-08-28 02:12:07 UTC (rev 64456)
+++ trunk/libgdiplus/src/ChangeLog      2006-08-28 02:25:36 UTC (rev 64457)
@@ -1,6 +1,6 @@
 2006-08-27  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
-       * bitmap.c: Fix endian issue in 32 bits bitmaps.
+       * bitmap.c: Fix endianess issues in locked bitmap.
 
 2006-08-25  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 

Modified: trunk/libgdiplus/src/bitmap.c
===================================================================
--- trunk/libgdiplus/src/bitmap.c       2006-08-28 02:12:07 UTC (rev 64456)
+++ trunk/libgdiplus/src/bitmap.c       2006-08-28 02:25:36 UTC (rev 64457)
@@ -1618,7 +1618,14 @@
                 * Note that pixel streams do not support 48- and 64-bit data 
at this time.
                 */
 
+#if WORDS_BIGENDIAN
+               *(state->scan) = (pixel_value >> 16) & 0xFF;
+               *(state->scan + 1) = (pixel_value >> 24);
+               *(state->scan + 2) = (pixel_value & 0xFF);
+               *(state->scan + 3) = (pixel_value >> 8) & 0xFF;
+#else
                *(unsigned int *)state->scan = pixel_value;
+#endif
                 /* We always do 4 here, as the internal representation is 
always 32 bits */
                state->scan += 4;
                /* state->scan -= state->pixels_per_byte; */

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to