You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to rotate 30 degrees at the center of the picture.
The problem now found is that the watermark content is larger than the width of the image will report an error.
var brush = new RecolorBrush(color, color, 1f);
// Use the optimal font size found
Font scaledFont = new(font, minFontSize);
// Create text options with adjusted font
RichTextOptions textOptions = new(scaledFont)
{
Origin = new Vector2(padding, imageSize.Height * .5f),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center,
WrappingLength = targetWidth
};
//I Want Rotate 30°
DrawingOptions drawingOptions = new DrawingOptions
{
Transform = Matrix3x2Extensions.CreateRotationDegrees(30, new PointF(targetWidth / 2, targetHeight / 2))
};
// Draw the text on the image
return processingContext.DrawText(drawingOptions, textOptions, text, brush, null);
error:System.ArgumentOutOfRangeException:“Specified argument was out of the range of valid values. Arg_ParamName_Name”
The text was updated successfully, but these errors were encountered: