Aurigma Forums
 » 
Graphics Mill
 » 
Discussions – Graphics Mill
 » 
Transfer a clipping path from one (or multiple) image to another one
 
		
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 5/10/2017(UTC)
 Posts: 33
 
 Thanks: 10 timesWas 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 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
         
		   
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 7/28/2003(UTC)
 Posts: 1,660
 
 Thanks: 5 timesWas thanked: 76 time(s) in 74 post(s)
 
 | 
            
	      
                Sebastian,
 Which way do you check whether an image has a clipping path? Do you use Adobe Photoshop?
 | 
| Best regards, Fedor Skvortsov
 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
    
		
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 5/10/2017(UTC)
 Posts: 33
 
 Thanks: 10 timesWas 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 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
         
		   
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 7/28/2003(UTC)
 Posts: 1,660
 
 Thanks: 5 timesWas thanked: 76 time(s) in 74 post(s)
 
 |  | 
| Best regards, Fedor Skvortsov
 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
    
		
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 5/10/2017(UTC)
 Posts: 33
 
 Thanks: 10 timesWas thanked: 1 time(s) in 1 post(s)
 
 |  | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
    
Aurigma Forums
 » 
Graphics Mill
 » 
Discussions – Graphics Mill
 » 
Transfer a clipping path from one (or multiple) image to another one
 
    
        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.