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

Notification

Icon
Error

Options
Go to last post Go to first unread
JoshSmith  
#1 Posted : Wednesday, May 31, 2023 11:09:40 AM(UTC)
JoshSmith

Rank: Newbie

Groups: Member
Joined: 10/27/2022(UTC)
Posts: 8

Thanks: 4 times
Having some issues resizing the photo/image that I am replacing using the following code. It doesn't seem to matter what ResizeMode I choose the results are the same, the image seems to be stretched without regards to the aspect ratio. My understanding is that ResizeMode.ImageFill is supposed to proportionally resize and crop the image, not stretch to fill. It's possible I'm implementing it incorrectly, which is why I am hoping for some feedback. Thanks in advance.

private static MemoryStream ReplacePhoto(MemoryStream preparedStream, PsdProcessor psdProcessor)
{
psdProcessor.FrameCallback = (processor, frame) =>
{
if (frame.Type != FrameType.Raster)
return processor.ProcessFrame(frame);

if (frame.Name == "Photo")
{
// Now the memory stream can be used with ImageReader.Create
using (var background = ImageReader.Create(preparedStream))
{
background.CloseOnDispose = false;
return frame.ToGraphicsContainer(background, ResizeMode.ImageFill);
}
}

return processor.ProcessFrame(frame);
};
return preparedStream;
}
Eugene Kosmin  
#2 Posted : Thursday, June 1, 2023 7:27:20 PM(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)
Hi,

Could you post here your PSD and background files?
Best regards,
Eugene Kosmin
The Aurigma Development Team
thanks 1 user thanked Eugene Kosmin for this useful post.
JoshSmith on 6/2/2023(UTC)
JoshSmith  
#3 Posted : Friday, June 2, 2023 7:14:27 AM(UTC)
JoshSmith

Rank: Newbie

Groups: Member
Joined: 10/27/2022(UTC)
Posts: 8

Thanks: 4 times
As soon as I saw your reply I looked at my PSD file and realized I was doing something dumb on my end. My PSD is an 8x10 or 4:5 sized image with a simple overlay over top the image. I was adding in the photo, changing the whole file to a jpg and then squishing it to fit a sheet of 2-5x7s. Obviously a 5x7 is a different ratio from 4:5 and the second process is what was squishing my images down, not Graphics Mill. That was my dumb mistake. Thanks for the response.
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.