cairo linear gradient with BUG?

丹青(Hishop) <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CADot+uyhz+f+L_qGdmX3NkC_XDiaYr4+KqPbX=qC22nb8DvTqQ@mail.gmail.com>
Hello, this is google translation, sorry!

I realize SWF To bitmap conversion is found a problem, the code is as
follows (using C # call cairo.dll,v1.12.14)

  Cairo.Context c = new Context (new ImageSurface (Format.ARGB32, 150,
150));
             Matrix m1 = new Matrix ();
             m1.Scale (0.1, 0.1);
             / / m1.Scale (0.5, 0.5);
             / / m1.Scale (1, 1);
             c.Matrix = m1;

             Cairo.LinearGradient lg = new LinearGradient (-16384, 0,
16384, 0);
             Cairo.Matrix m2 = new Matrix ();
             m2.Scale (0.01220703125, 0.01220703125);
             m2.Translate (3896.0, 0);
             m2.Invert ();
             lg.Extend = Extend.Repeat;
             lg.Matrix = m2;
             lg.AddColorStop (0, new Cairo.Color (0, 0, 0));
             lg.AddColorStop (0.4, new Cairo.Color (1, 0, 0));
             lg.AddColorStop (0.8, new Cairo.Color (1, 1, 0));
             lg.AddColorStop (1, new Cairo.Color (1, 1, 1));

             c.Pattern = lg;
             c.MoveTo (0, 0);
             c.LineTo (4096, 0);
             c.LineTo (4096, 4096);
             c.LineTo (0, 4096);
             c.LineTo (0, 0);
             c.ClosePath ();
             c.FillPreserve ();
             c.Color = new Cairo.Color (0, 0, 0, 1);
             c.Stroke ();
             c.Target.WriteToPng (@ "c: \ test.png");
             c.Target.Dispose ();

In the above code, if you use m1.Scale (1, 1); m1.Scale (0.5, 0.5);
gradient effect with the normal output picture, but if you use m1.Scale
(0.1,0.1); or low scaling, such as m1.Scale (0.05,0.05), the picture output
is blank.
I do not know whether this is a BUG, please test it yourself and give back.
Thank you!

Mail attachment in my test pictures, please check.

[image: 内嵌图片 2][image: 内嵌图片 3][image: 内嵌图片 1]

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
s1.png (image/png, 1.5 KB) - not displayed
s2.png (image/png, 1.4 KB) - not displayed
s4.png (image/png, 1.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.