M
m3ckon
Hi there,
was wondering if someone could help me.. I've been using GDI + to
overlay some text onto an image and it's displaying without any
problems.
However, I wanted to put the output into an image control so that I
could format it and manipulate it better.
I'm using the code below: (can someone tell me how I can either resize
the image I'm displaying or preferably how to add it to an image
control?? (please)
Public Function DisplayImage(ByVal imagepath As String)
Dim strimagepath As String
Dim strimgheight As String
Dim strimgWidth As String
Response.Clear()
strimagepath = imagepath
Dim imgOutput As New Bitmap(strimagepath)
Dim g As Graphics = Graphics.FromImage(imgOutput)
g.DrawString("Copyright 2004", New Font("verdana", 16,
FontStyle.Bold), SystemBrushes.WindowText, New PointF(2, 20))
imgOutput.Save(Response.OutputStream, ImageFormat.Jpeg) ' output
to the user
' tidy up
g.Dispose()
imgOutput.Dispose()
Response.End()
End Function
was wondering if someone could help me.. I've been using GDI + to
overlay some text onto an image and it's displaying without any
problems.
However, I wanted to put the output into an image control so that I
could format it and manipulate it better.
I'm using the code below: (can someone tell me how I can either resize
the image I'm displaying or preferably how to add it to an image
control?? (please)
Public Function DisplayImage(ByVal imagepath As String)
Dim strimagepath As String
Dim strimgheight As String
Dim strimgWidth As String
Response.Clear()
strimagepath = imagepath
Dim imgOutput As New Bitmap(strimagepath)
Dim g As Graphics = Graphics.FromImage(imgOutput)
g.DrawString("Copyright 2004", New Font("verdana", 16,
FontStyle.Bold), SystemBrushes.WindowText, New PointF(2, 20))
imgOutput.Save(Response.OutputStream, ImageFormat.Jpeg) ' output
to the user
' tidy up
g.Dispose()
imgOutput.Dispose()
Response.End()
End Function