473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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
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
3 1576
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jamie Davison | last post by:
I'm have GD 2.0.1 - php 4.3.5 compiled --with-gd--enable-gd-native-ttf--enable-gd-jis-conv --with-freetype-dir=/usr/local' '--with-t1lib=/usr/local...
1
by: Jack Charbonneau | last post by:
I have a bunch of custom fonts installed on my system. For instance if I look at the font drop-down in word pad I see about 90 fonts, but if I build an app using VS.Net, add a label, and try to...
3
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
0
by: MikeB | last post by:
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...
9
by: craig.overton | last post by:
All, I am currently developing an FTP class in VB.NET. It's kid tested, mother approved when trying to access an FTP Server on a Windows box meaning I can connect, run commands, upload and...
4
by: Dean Craig | last post by:
I'm getting ready to build my first ASP.NET/SQL Server website that will be hosted on some web host out there (long distance, different network). The work I've done in the past (pre-.NET) was all...
1
by: eblackmo | last post by:
I have a test network consisting of four servers running windows 2003 server R2 SP2. I have set up a domain which functioned correctly for about a day and a half until the other servers decided they...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.