473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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 ---
Nov 19 '05 #1
0 1107

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
Just wondering if there is a way to give a control focus when the page loads, for example so the user could start typing in a text box before clicking on it? Thanks, -- Paul G Software engineer.
3
by: veera | last post by:
Is it possible to give control focus using Asp.net code??
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
0
by: Coleen | last post by:
Hi All :-) This may be a duplicate post, so I apologize if it is, but I could not find the one I sent last week posted... I have an HTML table that I am using to store session variables from...
1
by: Samuel Shulman | last post by:
Hi I would like to allow user to 'POST' to another page but I want to send the query from the server i.e.. I want the user to click a button to say register the request, add up the fields that I...
0
by: =?Utf-8?B?Sm9obiBTLg==?= | last post by:
I programmed a dropdownlist via javascript and now I need to read the value from vb.net code (server side) . Then based on the value I will branch to seperate logic. How do I call a client...
1
by: .nLL | last post by:
Hi, i am new to asp.net, im working o sample project to learn and i want to be able to access code once i finished it. Im using visiual web developer 2008 and it compiles code as dll in bin folder....
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.