[Mono-bugs] BitmapData behaves differently in linux and windows platform

Manson Yeung aymanson at gmail.com
Tue Jul 4 09:02:22 EDT 2006

I use the windows installer to install mono 1.1.15 and use yum to install
mono in linux.
mono --version return 1.1.15 in both platform.

Then I try to run the following code.

Bitmap dstImg = new Bitmap(150, 112, PixelFormat.Format24bppRgb);
BitmapData dstData = dstImg.LockBits( new Rectangle(0, 0, 150, 112),

ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
Console.WriteLine("format " + dstData.PixelFormat.ToString());
Console.WriteLine("dstData.Stride " + dstData.Stride);
int dstOffset = dstData.Stride - 3* 150;
Console.WriteLine("dstOffset " + dstOffset);


The main concern is the dstData.Stride. I got 452 in windows platform but
600 in linux (fedora core 3).

dstData.PixelFormat.ToString() is "format Format24bppRgb" for both platform.

It seems that linux platform gdi use 32 bit ARGB when performing the
LockBits function. But it would be strange that dstData.PixelFormat still
return Format24bppRgb in linux platform.

Is this a bug for linux version mono or bug in linux OS?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-bugs/attachments/20060704/1c353424/attachment-0001.html 

More information about the mono-bugs mailing list