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

Discussion in 'ASP .Net' started by Tony, Apr 11, 2005.

  1. Tony

    Tony Guest

    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 ---
     
    Tony, Apr 11, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony
    Replies:
    3
    Views:
    3,364
  2. Tony

    ASPJPEG in vb.net ???

    Tony, Apr 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,344
    Kevin Spencer
    Apr 26, 2005
  3. , India
    Replies:
    2
    Views:
    478
    Fraser Ross
    Sep 15, 2009
  4. Christopher Brandsdal

    AspJpeg

    Christopher Brandsdal, Jul 31, 2003, in forum: ASP General
    Replies:
    0
    Views:
    189
    Christopher Brandsdal
    Jul 31, 2003
  5. ASPJPEG Help

    , Oct 6, 2005, in forum: ASP General
    Replies:
    1
    Views:
    142
Loading...

Share This Page