[Mono-dev] Re: ImageList patches r51171 and r51889 are notcompatible with MS.NET behaviour

Kornél Pál kornelpal at hotmail.com
Wed Oct 19 13:05:37 EDT 2005


Hi,

Please read my original message one again.:) I explained the differences
between MS.NET and this implementation. This difference is documented in my
previous message, in ImageList.cs and was documented when the modifications
were approved. And told you that if you think that this difference is
important let me know and I will modify ImageList to match MS.NET behaviour.
I did not say that everything is the same as in MS.NET I only said that I
don't think that MS.NET behaviour should be followed.

Usually it's a bad practicle to add images befor setting ColorDepth and
Images size but if you do so images will be cleared on Mono currently but
will not be cleared on MS.NET if handle was not created yet. Note that on
MS.NET if you modify ImageSize after adding images image strips will be
added incorrectly (if their size matches new size) or exception will be
thrown when creating handle and you will be unable to use the image list.

Your patch should not be retained because images are not modified after
handle was created the list is cleared instead.

And reducing image size without using ReduceColorDepth will result in 32-bit
images because of calculated colors.

Kornél

----- Original Message -----
From: "Jackson Harper" <jackson at ximian.com>
To: "Kornél Pál" <kornelpal at hotmail.com>
Cc: <mono-devel-list at lists.ximian.com>
Sent: Wednesday, October 19, 2005 6:27 PM
Subject: [Mono-dev] Re: ImageList patches r51171 and r51889 are
notcompatible with MS.NET behaviour


> On Wed, 2005-10-19 at 11:10 +0200, Kornél Pál wrote:
>> Hi,
>>
>> MS.NET ImageList creates handle when you first time retrieve or draw any
>> of
>> it's images. Until that is stores the original image object, after handle
>> creation it uses a native ImageList. It applies size and color depth when
>> handle is created. (This is documented in ImageList.cs.)
>>
>> After handle is created modifying ColorDepth or ImageSize results in
>> handle
>> recreation and the loss of all images.
>>
>> As we don't create any handle at all I decided to create it when images
>> are
>> added and apply size and colordepth when handle is created in other words
>> when they are added.
>>
>> Patches r51171 and r51889 are not compatible with MS.NET behaviour as
>> they
>> don't clear images after handle was created so these modifications should
>> not be preserved.
>
> Well what you had broke an existing application that runs fine on
> MS.NET, so you aren't entirely right.  I'm writing a test application
> now to find out when the images are cleared.
>
> Jackson
>
>
>> I belive that caching the images until using them is a bad idea as we
>> don't
>> use any native image list and doing time consuming operations at
>> initializaion is better as if you create an ImageList you do it because
>> you
>> want to access the images.
>>
>> If you think caching before handle creation behaviour is important after
>> considering the above things please let me know and I will implement that
>> behaviour.
>>
>> Kornél
>>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list