Skip to content

error demo:Sample-DrawWaterMarkOnImage-LongText #348

Description

@AryaOline

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”

企业微信截图_17356308615728

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions