السلام عليكم
في البداية أيها الاخوة وحتى يصحح لي المفهوم إن كنت مخطئ أعتقد أن استخدام :
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
أفضل من استخدام :
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
للمواد المطبوعة فهل هذا صحيح ؟
عندما نضع الكود التالي في حدث Paint للفورم فإننا نحصل على نتائج مختلفة فهل الخطأ في الكود أم في اللغة نفسها ؟
Dim r As Double = 0
Dim y As Integer = 0
Dim sz As SizeF
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
Dim st As String = "منتديات الفريق العربي للبرمجة"
Dim strFormat As New StringFormat(StringFormatFlags.DirectionRightToLeft)
Dim pn As New Pen(Color.Black, 2)
sz = e.Graphics.MeasureString(st, New Font("AL-Mohanad", 20, FontStyle.Bold))
r = (Me.Width / 2) + (sz.Width / 2)
y = 30
e.Graphics.DrawString(st, New Font("AL-Mohanad", 20, FontStyle.Bold), Brushes.Black, CInt(r), y, strFormat)
e.Graphics.DrawRectangle(pn, CInt(r) - sz.Width, y - 25, sz.Width, 20)
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
y += 70
sz = e.Graphics.MeasureString(st, New Font("AL-Mohanad", 20, FontStyle.Bold))
r = (Me.Width / 2) + (sz.Width / 2)
e.Graphics.DrawString(st, New Font("AL-Mohanad", 20, FontStyle.Bold), Brushes.Black, CInt(r), y, strFormat)
e.Graphics.DrawRectangle(pn, CInt(r) - sz.Width, y - 25, sz.Width, 20)لكم أجمل تحية