GDI+ not working as expected on different server

  • Thread starter Thread starter Richard Huff
  • Start date Start date
R

Richard Huff

I've been developing a web app on a local machine and I'm now at the
phase where I want to start beta testing. The main problem I'm having
is with GDI+ (i think). I use GDI+ to create an image that takes
advantage of POSTNET fonts and once the image is created it is rotated.
Everything else functions correctly except for these 2 issues. Both the
local machine and the test server have the same .NET Framework versions.
All fonts are installed correctly. The site works just fine when served
from my workstation, but not the server.

Here are some code samples if curious:

Dim pnFont As Font = New Font("ZipCodeBarcodeTT", 16)
Dim canvas As New Bitmap(500, 500)
Dim label As Graphics = label.FromImage(canvas)
Dim brush As New SolidBrush(Color.Black)
Dim text As String
'some text processing here
text += Me.Zip5 + vbNewLine
label.DrawString(text, bodyFont, brush, 0, halfSpace)
text = "s" + Me.Zip5 + Me.DeliveryPoint + Me.CheckDigit +"s"
label.TextRenderingHint = 0
label.DrawString(text, pnFont, brush, 0, space + 40)
'further image processing and object disposing


Here is the code used to rotate image:

mCanvas = New Bitmap(902, 662)
graphic = graphic.FromImage(mCanvas)
graphic.Clear(Color.White)
graphic.DrawImage(generateBarcode, 10, 552)
mCanvas.RotateFlip(RotateFlipType.Rotate90FlipNone)

Permissions seem to be setup correctly. Word on the server recognizes
the fonts...Is there something I'm missing?
 
It's really odd. I catch the errors and write them to a log. So the
app didn't go crazy with errors. The app couldn't find the font on the
system, according to the log. But there were no errors thrown when I
rotated the image. The code ran, but the image was not rotated.

Oddly enough, my boss updated IE to the latest version on the server
(which is 2000) at the same time I was testing and it started working
fine. I asked him what he did and he said, "I updated IE but I haven't
rebooted yet."
 
Back
Top