![]() |
|
| Original jpeg image | Negative image created in real time by negative.aspx |
In ASP.NET the Victor Library functions can be called directly from a server application to create an online image processor. In this example the file negative.aspx loads the image file and creates the negative image.
The sequence of operations is
<img src = "negative.aspx">To invoke negative.aspx from an ASP.NET page
image1.imageurl = "negative.aspx"
For a demonstration and source code for an online image processing application visit http://www.catenarysystems.com/demos/simple/simpip.aspx.
A more advanced image processing application is online at http://www.catenarysystems.com/vicimager. Source code for VicImager is free with purchase of the Victor Library.
NEGATIVE.ASPX
<%@ Page %>
<html>
<head>
<title>negative</title>
<!-- #include file="vicdefs.aspx" -->
<!-- #include file="vicread.aspx" -->
<script runat="server">
sub Page_Load
dim ezimage as imgdes
dim rcode as integer
dim outbuff as integer
dim imgbytearray as byte()
' Load an image
rcode = loadimagefromurl("http://www.catenarysystems.com/demos/images/hibiscus.png", ezimage)
' Do some processing
rcode = negative(ezimage, ezimage)
' Save it to a jpg file in memory, quality = 75
rcode = savejpgtobuffer(outbuff, ezimage, 75)
freeimage(ezimage)
' Send the image to the browser
imgbytearray = buffertobytearray(outbuff)
Response.ContentType = "image/jpeg"
Response.Expires = 0
Response.Buffer = true
Response.Clear
Response.BinaryWrite(imgbytearray)
Response.End
end sub
</script>
</head>
<body>
</body>
</html>
Victor Image Processing Library homepage | Victor Product Summary | more source code