By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,386 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,386 IT Pros & Developers. It's quick & easy.

jaggie fonts on server, but not on local host

P: n/a
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
String)
Dim strFileName, newImagePath As String
newImagePath = Server.MapPath("EcardsRendered/" & destImage &
".jpg")
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 =
System.Drawing.Image.FromFile(strFileName)
' 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),
sf)
g.Dispose()
end sub
==============================
any help would be appreciated.
thanks,


Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Did you try saving the image to disk on the server and then downloading that
same image to your PC and viewing it?

Are you sure the server has the same version of the .NET Framework?

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/foru...t10017013.aspx
http://www.eggheadcafe.com/articles/..._generator.asp

"MikeB" <Mi***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
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
String)
Dim strFileName, newImagePath As String
newImagePath = Server.MapPath("EcardsRendered/" & destImage &
".jpg")
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 =
System.Drawing.Image.FromFile(strFileName)
' 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),
sf)
g.Dispose()
end sub
==============================
any help would be appreciated.
thanks,

Nov 19 '05 #2

P: n/a
Did you try saving the image to disk on the server and then downloading that
same image to your PC and viewing it?

Are you sure the server has the same version of the .NET Framework?

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/foru...t10017013.aspx
http://www.eggheadcafe.com/articles/..._generator.asp

"MikeB" <Mi***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
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
String)
Dim strFileName, newImagePath As String
newImagePath = Server.MapPath("EcardsRendered/" & destImage &
".jpg")
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 =
System.Drawing.Image.FromFile(strFileName)
' 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),
sf)
g.Dispose()
end sub
==============================
any help would be appreciated.
thanks,

Nov 19 '05 #3

P: n/a
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?
"Robbe Morris [C# MVP]" wrote:
Did you try saving the image to disk on the server and then downloading that
same image to your PC and viewing it?

Are you sure the server has the same version of the .NET Framework?

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/foru...t10017013.aspx
http://www.eggheadcafe.com/articles/..._generator.asp

"MikeB" <Mi***@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
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
String)
Dim strFileName, newImagePath As String
newImagePath = Server.MapPath("EcardsRendered/" & destImage &
".jpg")
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 =
System.Drawing.Image.FromFile(strFileName)
' 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),
sf)
g.Dispose()
end sub
==============================
any help would be appreciated.
thanks,


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.