[Mono-bugs] [Bug 493047] New: Drawing a Bitmap which used LockBits and SetPixel results in a black image

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 7 17:26:22 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=493047


           Summary: Drawing a Bitmap which used LockBits and SetPixel
                    results in a black image
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: All
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: libgdiplus
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: stifu at free.fr
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=284629)
 --> (http://bugzilla.novell.com/attachment.cgi?id=284629)
Test case

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.7)
Gecko/2009022800 SUSE/3.0.7-1.1.6 Firefox/3.0.7

See test case (which has comments with more details).

For short: we have an unsafe FastBitmap class which contains a Bitmap and uses
the LockBits method.
We create a FastBitmap and set all of its pixel to red, then draw a clone of
the Bitmap contained in the FastBitmap.

With .NET, the image is red, with Mono, it is black (and is always all black,
regardless what the image can be like).

Note that we clone the bitmap before drawing it because we can't directly draw
the original bitmap due to it being locked. However, Mono doesn't mind if you
try to draw it directly, it still draws it as black, while .NET throws an
exception saying the Bitmap is locked.

This bug doesn't happen with Mono on Windows, most likely due to using the
original GDI+ library rather than libgdiplus.

Reproducible: Always

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list