[Mono-dev] Patch to RotateFlip: reworks existing code and adds 1-and 4-bit support

Jonathan Gilbert 2a5gjx302 at sneakemail.com
Mon Oct 24 02:47:21 EDT 2005


At 10:44 PM 23/10/2005 -0600, Peter Dennis Bartok wrote:
>Jonathan,
>
>I haven't reviewed the patch yet, but I noticed that you put the tests for 
>it in winforms; it'd be cool you would nunit-ify them and put them straight 
>under System.Drawing/Test? Maybe using GetPixel to verify it rotated 
>correctly. That way it could be automated. The winforms module is mostly 
>meant for visual test applications.
>
>I'll respond on the patch tomorrow, after I had a chance to review.
>
>Cheers,
>  Peter

I poked around in the System.Drawing tests and found that there was already
a test in place for rotation of non-indexed bitmaps, so I added a test for
just 1- and 4-bit bitmaps (see attached patch). It uses Marshal.ReadByte()
in conjunction with Bitmap.LockBits() to read the packed representation of
the pixels. I hope this is okay :-)

Sorry for adding inappropriate tests to the winforms module. If you'd like,
I could hack up the tests there to display their results visually ;-)

Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotate1bit4bit-test.patch.gz
Type: application/octet-stream
Size: 2093 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051024/c303e421/attachment.obj 


More information about the Mono-devel-list mailing list