Example aspjpeg in vbscipt in asp.net

Discussion in 'ASP .Net' started by Tony, Mar 31, 2005.

  1. Tony

    Tony Guest

    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.
     
    Tony, Mar 31, 2005
    #1
    1. Advertising

  2. Tony

    Brock Allen Guest

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

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > 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.
     
    Brock Allen, Mar 31, 2005
    #2
    1. Advertising

  3. Tony

    Mike Douglas Guest

    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

    On 30 Mar 2005 16:55:26 -0800, (Tony) wrote:

    >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.
     
    Mike Douglas, Mar 31, 2005
    #3
  4. Tony

    Tony Guest

    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 ---
     
    Tony, Apr 10, 2005
    #4
    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. dave
    Replies:
    0
    Views:
    1,322
  2. Tony
    Replies:
    0
    Views:
    546
  3. Tony

    ASPJPEG in vb.net ???

    Tony, Apr 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,374
    Kevin Spencer
    Apr 26, 2005
  4. Christopher Brandsdal

    AspJpeg

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

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

Share This Page