Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
SebastianR  
#1 Posted : Tuesday, August 29, 2017 11:09:00 PM(UTC)
SebastianR

Rank: Advanced Member

Groups: Member
Joined: 5/10/2017(UTC)
Posts: 33

Thanks: 10 times
Was thanked: 1 time(s) in 1 post(s)
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.

Code:

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 ( Result.tif (257kb) downloaded 10 time(s).) to exactly match the blue area of the source ( Pfad-1.tif (28kb) downloaded 9 time(s).). Is this a bug or do I miss something? Think

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

Edited by user Tuesday, August 29, 2017 11:14:43 PM(UTC)  | Reason: Attachments references restored

Fedor  
#2 Posted : Wednesday, August 30, 2017 8:13:43 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Originally Posted by: SebastianR Go to Quoted Post
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.

Originally Posted by: SebastianR Go to Quoted Post
1359[/attach]) to exactly match the blue area of the source ( Pfad-1.tif (28kb) downloaded 9 time(s).). Is this a bug or do I miss something? Think


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:

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


Best regards,
Fedor Skvortsov
SebastianR  
#3 Posted : Wednesday, August 30, 2017 9:50:40 PM(UTC)
SebastianR

Rank: Advanced Member

Groups: Member
Joined: 5/10/2017(UTC)
Posts: 33

Thanks: 10 times
Was thanked: 1 time(s) in 1 post(s)
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.
Eugene Kosmin  
#4 Posted : Thursday, August 31, 2017 12:59:30 AM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Try to use the FillingRule property:

Code:
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();
    }
}
Best regards,
Eugene Kosmin
The Aurigma Development Team
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.