Skip to content

Auto center alignment of the nickname #85

Answered by tocsoft
sadness-mugetsu asked this question in Q&A
Discussion options

You must be logged in to vote

You can configure the engine with various alignments, the bellow uses the Center alignment with a drawing point of the center of the image this will cause the text to draw outwards left and right evenly from the point specified.

Image image = ...; // create any way you like.
Font font = ...; // see our Fonts library for best practices on retriving one of these.

TextGraphicsOptions options = new TextGraphicsOptions()
{
    HorizontalAlignment = HorizontalAlignment.Center // center align
};

IBrush brush = Brushes.Horizontal(Color.Red, Color.Blue);
IPen pen = Pens.DashDot(Color.Green, 5);
string text = "sample text";
int halfImageWidth = image.Width / 2;

// draws a star with Horizontal re…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@tocsoft
Comment options

@luoxgwb
Comment options

@tocsoft
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by tocsoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants