[Mono-dev] Bug #75063 - Graphics.DrawImage(Image, PointF[]) throws exception

Sebastien Pouliot sebastien.pouliot at gmail.com
Mon Apr 24 10:33:09 EDT 2006

Hello Bill,

On Mon, 2006-04-24 at 09:43 -0400, Bill Holmes wrote:
> I was reading bug 75063 last night and the discussions matrix
> rotations sounded familiar.
> "I fixed a few issues but the bug is not completly fixed since I have
> been unable to plement properly the matrix rotations to match MS
> behaviour. Any help on this issue will be appreciated.
> Jordi,"
> I was looking into the libgdi code for problems I was experiencing
> with the lineargradientbrush and I found a method (GdipCreateMatrix3)
> that enabled me to solve my problems.   If I understand the method
> correctly it creates a transformation matrix from a rectangle to three
> points that define a parallelogram.  I believe that this is what is
> needed to resove bug 75063.
> My solution is to create a matrix using GdipCreateMatrix3 and apply it
> to the current context.  After the paint I set the original matrix
> back to the context.

I found out the hard way (i.e. after using it for a while to
re-implement parts of lineargradientbrush) that some (well most) of the
matrix creation functions, including GdipCreateMatrix3, were totally

The matrix problem were fixed in r59313 on April 10th - a long time
after the comments on bug #75063. I guess this explains very well
Jordi's problem to match MS results.

> The only test case I have is the one from the bug.  I tried to vary
> the points several ways to compare to MS's output.
> I am new to posting and am not sure what tests should be run and where
> they are.  Any links or info that someone can pass along would be
> helpful.
> I have attached the image.c file from libgdiplus and the diff file as well.

The diff file is enough and it's better if it can be sent without
compression (as it is easier to review). However when a bug report is
open, it's best to attach the diff to the bug report and change it's
summary to "[PATCH] ...old summary".

Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/

More information about the Mono-devel-list mailing list