Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=80681 --- shadow/80681 2007-01-31 12:44:44.000000000 -0500 +++ shadow/80681.tmp.18083 2007-01-31 14:27:42.000000000 -0500 @@ -123,6 +123,42 @@ } } ------- Additional Comments From [EMAIL PROTECTED] 2007-01-31 12:44 ------- For your first sample the problem occurs when unlocking. Commenting the UnlockBits produce a correct output bitmap. + +------- Additional Comments From [EMAIL PROTECTED] 2007-01-31 14:27 ------- +Are you sure? If I doesn't unlock the bitmap, the bitmap is saved at +the previous state. + +using System.Drawing; +using System.Drawing.Imaging; +class MainClass +{ + public static void Main(string[] args) + { + Bitmap bitmap = new Bitmap("image.jpg"); + BitmapData bmData = bitmap.LockBits(new +Rectangle(0,0,bitmap.Width,bitmap.Height), +ImageLockMode.ReadWrite,PixelFormat.Format24bppRgb); + bitmap.Save("image1.png",ImageFormat.Png); // image is ok + unsafe { + byte *imgPtr = (byte*)(bmData.Scan0); + for( int i = 0 ; i < bmData.Height ; i ++ ) { + for( int j = 0 ; j < bmData.Width ; j ++ ) { + imgPtr[0] = 0; + imgPtr[1] = 255; + imgPtr[2] = 255; + + imgPtr += 3; + } + imgPtr += bmData.Stride - bmData.Width * 3; + } + } + bitmap.Save("image2.png",ImageFormat.Png);// image is ok, but it's +the pre-locked image + bitmap.UnlockBits(bmData); + bitmap.Save("image3.png",ImageFormat.Png); // image is +ok and yellow + } +} _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
