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

Jackson Harper jackson at ximian.com
Wed Oct 19 12:27:24 EDT 2005


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
> 




More information about the Mono-devel-list mailing list