Example aspjpeg in vbscipt in asp.net

T

Tony

Hello,

I'm using already a long time aspjpeg in asp to add my logo and some
text over my images on my website.

Since a couple of months I changed over to asp.net in vbscript. But I
don't find the way to write the code to be able to use aspjpeg with
vbscript in asp.net Who can give me some complete code examples to do
this?

I'm looking especially for the translation of "manythumbs" &
"sendbinary" in vb.net

I'm looking forward to read your answers here !

Many thanks,
Tony.
 
B

Brock Allen

What do these libraries do for you? Perhaps there's a better way in ASP.NET
without replying upon those older COM components.
 
M

Mike Douglas

Tony,

Here's a small sample of using the ASPJPEG component in .NET

'' Upload Image
Dim largejpeg As New ASPJPEGLib.ASPJpeg
Dim smalljpeg As New ASPJPEGLib.ASPJpeg

Dim a, b, x, aa, bb, y As Integer
Dim orig As String = Server.MapPath("images/" & imagename)
Dim localpath As String =
ConfigurationSettings.AppSettings("localpath")
Dim small As String = localpath & "images\FroggerSM.jpg"
Dim large As String = localpath & "images\FroggerLG.jpg"
largejpeg.Open(orig)

I hope this helps. If not post your asp code up here and I can help
convert it.

Also you might take a look at the GDI+ library in .NET. You can
probably replace everything you were doing with ASPJPEG with it.

I hope this helps

Mike Douglas

www.doitconsultants.com
 
T

Tony

First of all thanks for the help, but I have still not found a working
solution. As explained, I have a good working version in ASP. The code
is included below.

With this code I create a red bar on the bottom of the image, in which
I give some comment on the image and the URL of the website. In the
code image.asp I define teh file name of the image (img), the comment
(txt) and the url (url). In the later stage, this info is 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,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top