[Mono-devel-list] [Patch] System.Drawing.Bitmap .NET Framework compatibility

Kornél Pál kornelpal at hotmail.com
Sat May 14 06:14:49 EDT 2005


Hi,

System.Drawing.Bitmap in .NET Framework implements new Bitmap(original, ...)
constructorst as copying the original bitmap to a memory bitmap.

Mono implements it using GdipCloneBitmapAreaI.

I don't know the behaviour of Cairo but GdipCloneBitmapAreaI on GDI+ results
in a bitmap based on the original.

As GDI+ draws bitmaps from the stream if they were created from a stream
this different implementation of the above contructors results in
significant difference as the stream should be closed while the bitmap uses
it, otherwise the bitmap cannot be rendered.

BitmapFromImage is not needed for this constructor and is not recommended in
MakeTransparent.

And not that using Dispose (that calls GC.SuppressFinalize) in
BitmapFromImage result in memory leak as the new image will never be
disposed.

Sincerely,
Kornél
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bitmap.diff
Type: application/octet-stream
Size: 3439 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050514/e2acd45c/attachment.obj 


More information about the Mono-devel-list mailing list