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 : Wednesday, August 30, 2017 1:07:45 AM(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,
I want to create a new image with clipping paths from other images. I came up with:
Code:

public void TransferClippingPath()
{
    using (var reader = ImageReader.Create(@""))
    {
        var clippingPath = reader.ClippingPaths.First();
        var path = Path.Create(clippingPath, 256, 256);
                
        using (var maskGen = new  ImageGenerator(reader, RgbColor.Transparent))
        using (var writer = new TiffWriter(@"..\Result.tif"))
        {
            writer.Setup(new TiffSettings(CompressionType.Lzw));
                    
            maskGen.GraphicsContainer = new GraphicsContainer(maskGen);
            maskGen.GraphicsContainer.GetGraphics().ClippingPaths.Add(path);
            (maskGen + writer).Run();
        }
    }
}

, but there is no path at all in the result. How do I accomplish this? What do I have to do, if I want paths from multiple images in the new one?

Regards
Sebastian
Fedor  
#2 Posted : Wednesday, August 30, 2017 3:21:10 AM(UTC)
Fedor

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 58 time(s) in 57 post(s)
Sebastian,

Which way do you check whether an image has a clipping path? Do you use Adobe Photoshop?
Best regards,
Fedor Skvortsov
SebastianR  
#3 Posted : Wednesday, August 30, 2017 3:38:32 AM(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)
Greetings Fedor,
Yes, I did use Photoshop, but I also used
Code:

using (var reader = ImageReader.Create(@"..\Result.tif"))
{
    var cpcount = reader.ClippingPaths.Count; //ClippingPaths is null, throws System.NullReferenceException
}

which throws a System.NullReferenceException.

Regards
Sebastian
Fedor  
#4 Posted : Wednesday, August 30, 2017 7:37:28 AM(UTC)
Fedor

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 58 time(s) in 57 post(s)
I got it. You should use clipping paths stored in Adobe image resource blocks:

https://www.graphicsmill.com/doc...pping-path.htm#copyingCP

The AdvancedGraphics.ClippingPaths property should be used to specify a clipping zone during drawing.
Best regards,
Fedor Skvortsov
SebastianR  
#5 Posted : Wednesday, August 30, 2017 9:55:21 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)
d'oh! d'oh! d'oh! OMG, I totally jumped over that section. I am sorry wasting your time.
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.