Replies: 3 comments
-
You could do something like this: var settings = new MagickReadSettings
{
Width = 1000,
Height = 1000,
TextGravity = Gravity.Center,
};
using var image = new MagickImage("label:Test", settings); This will put the text "Test" inside the 1000x1000 image and make it as large as possible. |
Beta Was this translation helpful? Give feedback.
-
Thanks @dlemstra , Edit: unless your intention behind the reply above is that I would overlay that image on top of or inside the spliced area of the original image? Not sure I understand. I may not be explaining what I'm trying to do correctly. Here's a couple images that may show it better. Here's a lower resolution image with the spliced white area at the top, and an annotation written inside it (same as using code from my original post) Here's a higher resolution image with the same code, but the font size doesn't scale correctly so it's very tiny Maybe this shows what I'm running into better and can help find a solution. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Instead of creating a splice you could also calculate those dimensions yourself and create an image of that size with the label example. And then with an |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have code like this:
But I'd like to set the font size to something relative to the dimensions of the image.
I see in imagemagick docs that not setting a font size will tell imagemagick to automatically scale to try and fit the image, but I don't see that behavior here, or I don't know how to do what I'm trying to with this API.
If there's no way to have it automatically scale, perhaps something based around this?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions