The parameter "ResizeOptions.PadColor" has no effect. Is there a problem with my calling method? #2669
-
hello, new ResizeOptions {
Mode = ResizeMode.Manual,
PadColor = SixLabors.ImageSharp.Color.Blue,
..........
} The parameter "PadColor" has no effect. Is there a problem with my calling method? using (var originalImage = SixLabors.ImageSharp.Image.Load<SixLabors.ImageSharp.PixelFormats.Rgba32>(imageStream))
{
var resizeOptions = new ResizeOptions
{
Size = new SixLabors.ImageSharp.Size(200, 1000),
TargetRectangle = new SixLabors.ImageSharp.Rectangle(50, 50, 100, 100),
Mode = ResizeMode.Manual,
PadColor = SixLabors.ImageSharp.Color.Blue,
};
originalImage.Mutate(x => x.Resize(resizeOptions));
originalImage.SaveAsWebp("out.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder()
{
Quality = imageQuality,
});
} |
Beta Was this translation helpful? Give feedback.
Answered by
JimBobSquarePants
Feb 18, 2024
Replies: 2 comments
-
You’re not padding the image. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thinksea
-
Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You’re not padding the image.
ResizeMode.Pad