473,714 Members | 3,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASPJPEG in vb.net ???

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>AspJpe g - Image with comment in red bar</title>
</HEAD>
<BODY>
<CENTER>

<%
img = Server.URLEncod e(Server.MapPat h("img014.jpg") )
txt = Server.URLEncod e("014 Comment on bottom of image")
url = Server.URLEncod e("www.domain.c om")
%>
<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.CreateOb ject("Persits.J peg")
Jpeg.Open(Reque st("img"))

Set OK = Server.CreateOb ject("Persits.J peg")
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
2 1804
Your looking to use the System.Drawing namespace and GDI+. Hit google for
the howto's
Nov 19 '05 #2
Hi Tony,
Hello I have a working code for asp that I want to use now in asp.net.
No you don't. You just THINK you want to do that. Why? Let me explain.

First, ASP and ASP.Net have very little in common. You can't simply
"convert" ASP to ASP.Net in many cases. They are completely different
programming paradigms. One is scripted, and one is a fully-compiled
programming technology. One is procedural, and the other is object-oriented.
ASP uses COM to do the heavy lifting. ASP.Net has the full power of the .Net
platform behind it, and can lift anything you want all by itself. In fact,
the 2 technologies are so different that ASP.Net doesn't do COM. To do COM
with ASP.Net you have to do a nasty little workaround called Interop, which
is costly and dangerous.

In this specific case, you're using a third-party COM component (Persits) to
generate an image on the server side. What you would do in ASP.Net is use
the System.Drawing and System.Drawing. Imaging namespaces to generate an
image. Once the image is generated on the server side (by an ASP.Net page,
similarly to the way you're using an ASP page in your existing code), the
ASP.Net page would set the Response.Conten tType property to "image/jpg" and
save the image to the Response.Output Stream.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Tony" <sp***@pandora. be> wrote in message
news:7f******** *************** ***@posting.goo gle.com... 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>AspJpe g - Image with comment in red bar</title>
</HEAD>
<BODY>
<CENTER>

<%
img = Server.URLEncod e(Server.MapPat h("img014.jpg") )
txt = Server.URLEncod e("014 Comment on bottom of image")
url = Server.URLEncod e("www.domain.c om")
%>
<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.CreateOb ject("Persits.J peg")
Jpeg.Open(Reque st("img"))

Set OK = Server.CreateOb ject("Persits.J peg")
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 #3

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

Similar topics

0
2828
by: Christopher Brandsdal | last post by:
Hello! I am making a upload script for my images. I want the script to resize the images automaticly. The server supports AspJpeg but i don't have AspUpload. Can anyone help me to implement the AspJpeg code into my upload code? AspJpeg CODE. '---------------------------------------------------------------------------
1
2239
by: audiopro | last post by:
I am having some trouble here, and my brain is running on empty. I am not an expert ASP coder, so forgive me for what is probably sloppy code, and not the best... At any rate, I have created the following code to randomly select an image under a random set of folders from my gallery. Once that is done, I call sendbinary.asp which should size and display the image... Here is my code. Problem is, I am getting a good ole red X. It looks...
3
1761
by: Tony | last post by:
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?
0
1117
by: Tony | last post by:
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....
0
2833
by: dann2 | last post by:
hello, i try to upload in an access db two pictures at the same time. i use the adjusted sample code from persits. it looks like this: ... '<% ' Create an instance of AspUpload object 'Set Upload = Server.CreateObject("Persits.Upload") ' Capture uploaded file. Save returns the number of files uploaded 'Count = Upload.Save(Path) 'If Count = 0 Then 'Response.Write "message"
0
8712
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9179
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9077
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5959
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.