S
Saeid
Hi All,
I'm trying tp print to texts in the same position with
different font sizes on a graphics object (say a printer
or a picturebox) and I'm using the format string object
to remove spaces around a character but it doesn't work.
Private Sub PictureBox1_Paint(ByVal sender As
Object, ByVal e As System.Windows.Forms.PaintEventArgs)
Handles PictureBox1.Paint
'
Dim format As New StringFormat(CType
(StringFormat.GenericTypographic.Clone, StringFormat))
With e.Graphics
.PageUnit =
GraphicsUnit.Millimeter
.TextRenderingHint =
TextRenderingHint.AntiAlias
.DrawLine(New Pen(Color.Blue),
10, 0, 10, 200)
.DrawString("P", New Font
("Arial", 10, GraphicsUnit.Millimeter), Brushes.Green,
New RectangleF(10, 10, 100, 100), format)
.DrawString("P", New Font
("Arial", 48, GraphicsUnit.Millimeter), Brushes.Green,
New RectangleF(10, 10, 150, 165), format)
End With
'
End Sub
Does anyone have any idea how to work out this problem.
Any help appreciated.
Regards,
Saeid
I'm trying tp print to texts in the same position with
different font sizes on a graphics object (say a printer
or a picturebox) and I'm using the format string object
to remove spaces around a character but it doesn't work.
Private Sub PictureBox1_Paint(ByVal sender As
Object, ByVal e As System.Windows.Forms.PaintEventArgs)
Handles PictureBox1.Paint
'
Dim format As New StringFormat(CType
(StringFormat.GenericTypographic.Clone, StringFormat))
With e.Graphics
.PageUnit =
GraphicsUnit.Millimeter
.TextRenderingHint =
TextRenderingHint.AntiAlias
.DrawLine(New Pen(Color.Blue),
10, 0, 10, 200)
.DrawString("P", New Font
("Arial", 10, GraphicsUnit.Millimeter), Brushes.Green,
New RectangleF(10, 10, 100, 100), format)
.DrawString("P", New Font
("Arial", 48, GraphicsUnit.Millimeter), Brushes.Green,
New RectangleF(10, 10, 150, 165), format)
End With
'
End Sub
Does anyone have any idea how to work out this problem.
Any help appreciated.
Regards,
Saeid