Hi All,
I draw some text onto a picture box with the code below but for some reason the text does not get drawn at the position 0,0 why?
I have attached a image to show the output.
Code:private void button2_Click(object sender, EventArgs e) { FontFamily fm = new FontFamily("Arial"); StringFormat st = new StringFormat(); GP.AddString("Hello", fm, 1, 40, new PointF(0, 0), st); DrawString(); } private void DrawString() { Bitmap bat = new Bitmap(pictureEdit1.Width, pictureEdit1.Height); Image d = bat; Graphics graphics = Graphics.FromImage(d); graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; Brush textBrush = new SolidBrush(Color.Black); graphics.DrawPath(new Pen(textBrush), GP); pictureEdit1.Image = d; pictureEdit1.Refresh(); }
Thanks
Loftty




Reply With Quote