Add SVG to a specific position in image #343
-
|
Is there a way to specify where a SVG Path should be added in an image like for text ? I have this code right now : using var template = new Image<Rgb24>(imageWidth, imageHeight);
template.Mutate(image =>
{
image.AddLogo(imageWidth, imageHeight);
});
public static void AddLogo(this IImageProcessingContext imageContext, int width, int height)
{
var parsed = SixLabors.ImageSharp.Drawing.Path.TryParseSvgPath("...", out IPath path);
if (!parsed) throw new Exception();
var scaled = path.Scale(0.5f);
imageContext.Fill(Color.White, scaled);
}This works fine, the logo is rendered on the upper left part of my image. But I can't find a way to specify where I want it to be rendered. |
Beta Was this translation helpful? Give feedback.
Answered by
JimBobSquarePants
Jan 16, 2025
Replies: 1 comment
-
|
You can transform the path, offsetting it by the required amount. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JimBobSquarePants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can transform the path, offsetting it by the required amount.