[Mono-winforms-list] libgdiplus/System.Drawing patch: native support for indexed Bitmaps

Dan Maltes dan@astusa.com
Wed, 16 Mar 2005 16:15:01 -0500


Any chance there is existing TIFF loading code available that could be used
with permission in Mono?  Could save time.

Dan Maltes

-----Original Message-----
From: mono-winforms-list-admin@lists.ximian.com
[mailto:mono-winforms-list-admin@lists.ximian.com] On Behalf Of Jonathan
Gilbert
Sent: Wednesday, March 16, 2005 3:35 PM
To: mono-winforms-list@lists.ximian.com
Subject: Re: [Mono-winforms-list] libgdiplus/System.Drawing patch: native
support for indexed Bitmaps

At 02:08 PM 16/03/2005 -0300, Fabian Luque wrote:
>> Probably the cleanest way to remove the warning, without making the 
>> code do an extra assignment when it doesn't have to, is to add a 
>> 'default' block that sets it to 'NULL':
>> 
>>         default: default_palette = NULL;
>
>After making this change, libgdiplus compiled just fine.
>
>Now, when I open my 1bpp TIFF file and the save it to PNG I'm still 
>getting a 32bpp 180 KB file instead of a 1bpp file around 80 KB.

The problem here is that because the TIFF format is massive and complex, I
decided to postpone indexed TIFF loading support for a later patch. This
patch does not alter the way the TIFF codec loads TIFF files, and as such
they are upsampled to 32bpp at load time. Then, when you go to save the
Bitmap, the PNG codec says "hmm, this is a 32-bpp RGB Bitmap object, so I'll
make a 24-bit RGB PNG file".

Is it possible for you to pre-convert the TIFFs to another format, like BMP
or PNG, or is this the whole point of what you were trying to accomplish
using System.Drawing? :-)

Jonathan Gilbert

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list