7/8/2023 0 Comments Manga studio rotate textVariation #1: This snippet positions the upper-left corner of the text at (400, 200) and then rotates the text around that point: g.TranslateTransform(400, 200) (It's a good idea to dispose of Font and Graphics objects when you're done with them, so I've added a couple using statements.) G.DrawString("Hello world", font, Brushes.White, drawPoint) PointF drawPoint = new PointF(-size.Width / 2f, -size.Height / 2f) SizeF size = g.MeasureString("Hello world", font) Using (Graphics g = Graphics.FromImage(pictureBox1.Image)) If you want to draw rotated text at the center of the image, then offset the location of the text by half the measured size of the text: using (Font font = new Font("Arial", 80, FontStyle.Bold))
0 Comments
Leave a Reply. |