jaggie fonts on server, but not on local host



Hi all,

I have written an Ecard application which takes text input from the
user on one .aspx page and renders the message to a template .jpg and
displays the results on a 2nd .aspx page. The trouble is that my fonts
render fine on my local host machine but very jaggie on the server. IIS
5.1 is being used on my local host and our server is running windows
2000, IIS 5.0. However, my IT guy tells me there is no fundamental
differences between the two and it shouldn't affect my drawing output.
Here is my code:


Sub renderUserImage(ByVal srcImage As String, ByVal destImage As
Dim strFileName, newImagePath As String
newImagePath = Server.MapPath("EcardsRendered/" & destImage &
strFileName = srcImage

Dim newImageFormat As System.Drawing.Imaging.ImageFormat

newImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg

' create New image and bitmap objects.
Dim i As System.Drawing.Image =

' Render the users messag here
Dim g As Graphics = Graphics.FromImage(i)

g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality

g.InterpolationMode = Drawing.Drawing2D.InterpolationMode.High

Dim sf As StringFormat =
CType(StringFormat.GenericTypographic.Clone(), StringFormat)
sf.Alignment = StringAlignment.Center ' near, far or
center (paragraph)
sf.LineAlignment = StringAlignment.Center

' Fontsize adjustments:
If Me.UserFont = 0 Then
Me.DynFontSize = DynFontSize + 1
End If

If Me.UserFont = 1 Then
Me.DynFontSize = DynFontSize - 1
End If

If Me.UserFont = 3 Then
Me.DynFontSize = DynFontSize + 2
End If

' Build the drawstring dynamically:

g.DrawString(UserMessage, New Font(StrChosenFont, DynFontSize,
FontStyle.Regular), Brushes.Black, New RectangleF(354, 58, 224, 274),

end sub


any help would be appreciated.



Yes we have tried to check the rendered images and viewed it. The images that
were rendered are definitely bad quality.

Also just checked the .net framework version and both XP Pro and Windows
2000 are using the same (latest) version, ASP.NET_1.1.4322.2032

What else could be causing the differences in result?

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question