This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Issue: Graph is (still) not filled correctly

Hello Aurigma team,
first of all. I would have send you this via a support case, but the api does not allow to upload more than one image, so I report the issue here.

Executing the following code, I get unexpected results. Used images are the attachments.


public void FillPath()
{
    using (var reader1 = ImageReader.Create(@"..\Pfad-1.tif"))
    {
        var clippingPath = reader1.ClippingPaths.First();
        var path = Path.Create(clippingPath, 256, 256);
        path.Close(); //Just for safety, does not work without this, too.

        using (var maskGen = new ImageGenerator(new Size(256, 256), PixelFormat.Format32bppArgb, RgbColor.Transparent) { DpiX = 72, DpiY = 72 })
        using (var drawer = new Drawer())
        using (var writer = new TiffWriter(@"..\Result.tif"))
        {
            drawer.Draw += (sender, e) => { e.Graphics.FillPath(new SolidBrush(RgbColor.BlueViolet), path); };
            (maskGen + drawer + writer).Run();
        }
    }
}

I would expect the BlueViolet area of the result (attach #1359) to exactly match the blue area of the source (attach #1358). Is this a bug or do I miss something? 🤔

A while a go I submitted a similar case and I was told it would be fixed with the next update. Currently I am running version 9.1.28, x86.

Regards
Sebastian
SebastianR;32437
I would have send you this via a support case, but the api does not allow to upload more than one image, so I report the issue here.


You can attach additional images after submitting a case.

SebastianR;32437I would expect the BlueViolet area of the result ([attach
1359[/attach]) to exactly match the blue area of the source (attach #1358). Is this a bug or do I miss something? 🤔


Why do you expect the same color if you specify another one? You have the color [R=0, G=25, B=255, A=255] in the original image (Pfad-1.tif). The BlueViolet is [R=138, G=43, B=226, A=255].

So the following code produces the same color as in the original image:

drawer.Draw += (sender, e) => { e.Graphics.FillPath(new SolidBrush(new RgbColor(0, 25, 255)), path); };


I expect the areas to match, not the color.
If I use Photoshop CC to fill the area inside the path, the blue area is filled. In the source image, there are two yellow areas inside the blue one, but in the result from filling the path area with graphicsmill there is only one spot inside the blueviolet area.

Please forgive me, if I was not precise enough.
Try to use the FillingRule property:

using (var reader1 = ImageReader.Create("Pfad-1.tif"))
{
    var clippingPath = reader1.ClippingPaths.First();
    var path = Aurigma.GraphicsMill.AdvancedDrawing.Path.Create(clippingPath, 256, 256, true);
    path.Close(); //Just for safety, does not work without this, too.

    using (var maskGen = new ImageGenerator(new System.Drawing.Size(256, 256), PixelFormat.Format32bppArgb, RgbColor.Transparent) { DpiX = 72, DpiY = 72 })
    using (var drawer = new Drawer())
    using (var writer = new TiffWriter("Result.tif"))
    {
        drawer.Draw += (sender, e) => 
        {
            e.Graphics.FillingRule = FillingRule.EvenOdd;
            e.Graphics.FillPath(new SolidBrush(RgbColor.BlueViolet), path);
        };
        (maskGen + drawer + writer).Run();
    }
}