Putting text into an image and downloading it via Response.BinaryWrite
-
I have an application that "serves" barcode images to client pages. It is called by referencing the server page in the "src" or "ImageURL" property of an img object, along with parameters, such as <img src="barcode.aspx?code=ABCDEF123&width=3&height=0.75&barcolor=Red" alt="" /> It's working well, but now I'm trying to handle any errors that might occur. I would like to place the error description on an image that I download to the client page in place of the barcode image that *would* have been displayed if there had been no errors. I'm getting totally confused by all the graphics options. All I know is that I start with my message text ("rs_Message"), somewhere in the middle there'll be a "Dim Image As Byte()" line, and I need to end with the lines:
Response.Clear() Response.ContentType = "image/gif" Response.BinaryWrite(Image) Response.End()
Any thoughts?