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

Notification

Icon
Error

Options
Go to last post Go to first unread
b.prajapati  
#1 Posted : Friday, June 22, 2018 3:36:33 AM(UTC)
b.prajapati

Rank: Newbie

Groups: Member
Joined: 6/22/2018(UTC)
Posts: 1

I have one psd files which have three smart object and i need to pass different image for each layer.

I have tried many times but did not get success.

My smart objects frame names are below :-

Frontimg

Backimg

Leftimg

I need to pass different images for each layer image. I have tried different way but not get success.

My code mentioned below :-

Code:
  var psdProcessor = new PsdProcessor();

            psdProcessor.FrameCallback = (processor, frame) =>
            {


                if (frame.Type == FrameType.SmartObject && frame.Name == "Backimg")
                {

                    string str = @"../../_Input/Copenhagen_CMYK.jpg"; //front img
                    var smartFrame = (PsdSmartFrame)frame;



                    return smartFrame.ToGraphicsContainer(ImageReader.Create(str),
                       ResizeMode.ImageFill);

                }
                else if (frame.Type == FrameType.SmartObject && frame.Name == "Frontimg")
                {
                    string str = @"../../_Input/Frame.png";


                    var smartFrame = (PsdSmartFrame)frame;



                    return smartFrame.ToGraphicsContainer(ImageReader.Create(str),
                       ResizeMode.ImageFill);

                }
                else if (frame.Type == FrameType.SmartObject && frame.Name == "Leftimg")
                {
                    string str = @"../../_Input/Apple.jpg";

                    var smartFrame = (PsdSmartFrame)frame;



                    return smartFrame.ToGraphicsContainer(ImageReader.Create(str),
                       ResizeMode.ImageFill);

                }
                else
                {
                    return processor.ProcessFrame(frame);
                }
                
              
            };

            psdProcessor.Render(@"../../_Input/Model-ex.psd", @"../../_Output/RenderMugPreview.png"); 

I got render image only "Copenhagen_CMYK.jpg" for all smart objects frames.

Edited by moderator Friday, June 22, 2018 7:51:28 PM(UTC)  | Reason: Not specified

Andrey Semenov  
#2 Posted : Monday, June 25, 2018 1:35:22 AM(UTC)
Andrey Semenov

Rank: Advanced Member

Groups: Administration
Joined: 7/4/2017(UTC)
Posts: 43

Was thanked: 12 time(s) in 12 post(s)
Could you please share your PSD file?

Regards,

Andrew

Users browsing this topic
Guest
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.