This patch causes regressions on big-endian architectures (please see the attached png file from endian.cs)

As such it should not be applied until these are resolved

-kangaroo

On 15-Mar-05, at 10:11 AM, Jordi Mas wrote:

Jonathan,

Thanks for your patch. If nobody says anything I'm going to commit it in
five or six hours, 11.00 GMT+1.

Jordi,

--
Jordi Mas i Hern�ndez - Mono development team - http://www.mono-project.com
Homepage and LiveJournal at http://www.softcatala.org/~jmas



!DSPAM:4236fce8249781901216834!

From:
"Jonathan Gilbert" <[EMAIL PROTECTED]>
Date: March 13, 2005 6:04:33 PM EST
To: [email protected]
Subject: Re: [Mono-winforms-list] libgdiplus/System.Drawing patch: native support for indexed Bitmaps


I originally wrote this message 4 days ago, and the list moderator has
still not approved it for submission (it was held because the attachments
exceed 40 KB). So, I have placed the attachments on a web server and
re-sent the messages without them.

The attachments are available at:

http://israel.logiclrd.cx/patch/

I'll take them down once the message with attachments hits the list.

Jonathan Gilbert

-----------------
Original message:
-----------------
At 02:12 AM 05/03/2005 -0500, I wrote:
Please find attached the following files:

* libgdiplus.diff (patch -p0 in ./libgdiplus)
* System.Drawing.diff (patch -p0 in ./mcs/class/System.Drawing)
* lockbits.tgz (tar zvfx in ./)

Updated diffs and some extra testing code: testgif.tgz (DOES NOT contain a
subdirectory; untar directly within the intended destination)

Changes from the previous patch:
* Fixed the call to gdip_is_an_indexed_pixelformat that did not actually
call the function because it was missing the argument list.
* Added indexed loading & saving support to gifcodec.c.
* Updated Image.Palette to behave like Microsoft's implementation. I
discovered its bizarre behaviour when I tried to write a program for the
Microsoft framework to save an indexed 8-bit Bitmap with a custom palette.
It does not actually behave like a property, and should really have been
engineered as two separate functions, since there is no persistence
involved. Reading from the property creates a new instance of
System.Drawing.Imaging.ColorPalette and fills it from the underlying GDI+
GpImage object. However, the underlying GpImage's palette is only updated
if you assign to the property. Since you are not allowed to create
instances of ColorPalette directly, you end up having to write code like this:

ColorPalette palette = my_bitmap.Palette;

for (int i=0; i < palette.Entries.Length; i++)
palette.Entries[i] = Color.FromArgb(ar, gu, ments);

my_bitmap.Palette = palette; /* assign the same instance back! if this is
skipped, the image file will display and save with the old palette */

This is not documented in MSDN! But whatever the case, mono now behaves the
same way.

Oh, and one other thing: This time I actually verified that the diffs apply
cleanly :-)

Jonathan Gilbert

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


<<inline: regression.png>>

Reply via email to