Using aspjpeg in asp.net (vb.net) - Code conversion from asp

T

Tony

Hello I have a working code for asp that I want to use now in asp.net.
The code is included below.

With this code I create a red bar on the bottom of an image, in which
I give some comment on the image and the URL of the website. In the
code image.asp I define the file name of the image (img), the comment
(txt) and the url (url). In the later stage in the project, this info
will be created dynamically depending on the requested image. The code
of sendbinary creates on the fly a new image, based on the 3
parameters.

I want to have this code now in vb.net to use it in my new asp.net web
application. Calling the current sendbinary.asp from an asp.net page
doesn't work.

Can someone please help me to rewrite this code?

Many thanks in advance!
Tony.

--- Code of image.asp ---

<HTML>
<HEAD>
<TITLE>AspJpeg - Image with comment in red bar</title>
</HEAD>
<BODY>
<CENTER>

<%
img = Server.URLEncode(Server.MapPath("img014.jpg"))
txt = Server.URLEncode("014 Comment on bottom of image")
url = Server.URLEncode("www.domain.com")
%>
<IMG src="sendbinary.asp?img=<%=img%>&text=<%=txt%>&url=<%=url%>"><BR>

</CENTER>
</BODY>
</HTML>

--- End of code test.asp ---

--- Code of sendbinary.asp ---

<%
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Jpeg.Open(Request("img"))

Set OK = Server.CreateObject("Persits.Jpeg")
OK.Open(Server.MapPath("empty.jpg"))

OK.Width = Jpeg.Width
OK.Height = Jpeg.Height + 21
OK.DrawImage 0, 0, Jpeg

OK.Canvas.Font.Color = &HFFFFFF 'white
OK.Canvas.Font.Family = "Arial"
OK.Canvas.Font.Size = 16
OK.Canvas.Print 10, Jpeg.Height+2, Request("text")
OK.Canvas.Print Jpeg.Width-134, Jpeg.Height+2, Request("url")

OK.Quality = 95

OK.SendBinary
%>

--- End of code sendbinary.asp ---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top