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

Notification

Icon
Error

Options
Go to last post Go to first unread
Kartik Langalia  
#1 Posted : Monday, February 1, 2010 4:36:26 PM(UTC)
Kartik Langalia

Rank: Member

Groups: Member
Joined: 1/31/2010(UTC)
Posts: 11

Hello,

Please advise me how to pull layers out of the PSD file and save them into separate files. We will be happy if you example of getting raster layers and saving it into other file. I want to update Text & Raster Layers as per User Inputs.

Edited by user Monday, February 1, 2010 4:42:37 PM(UTC)  | Reason: Not specified

Tamila  
#2 Posted : Tuesday, February 2, 2010 6:40:57 PM(UTC)
Tamila

Rank: Advanced Member

Groups: Member
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hi,

I hope the following sample helps you:

Code:
// Create advanced PSD reader object to work with the PSD file.
Aurigma.GraphicsMill.Codecs.AdvancedPsdReader psdReader = 
	new Aurigma.GraphicsMill.Codecs.AdvancedPsdReader();

// Create the bitmap object which will store the image extracted from layers.
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap();

// Open advanced PSD reader to be able to get layers.
psdReader.Open(@"C:\Temp\WorkingWithLayers.psd");

// Within each frame in reader check out that it is not unknown.
foreach (Aurigma.GraphicsMill.Codecs.AdvancedPsdFrame frame in psdReader)
{
	// Skip if the layer type is unknown.
	if (frame.Type != Aurigma.GraphicsMill.Codecs.PsdFrameType.Unknown)
	{
		// Extract the image from the layer.
		frame.GetBitmap(bitmap);
		
		// Save layer image in PNG format.
		bitmap.Save(@"C:\Temp\" + "frame_" + frame.Index + ".png");
	}
}
// Clean up.
psdReader.Close();

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

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.