Victor Image Processing Library How-to Tips

Online Image Processing

hibiscus.png hibiscus.png processed online to its negative image
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

The ASP.NET file negative.aspx can be assigned to a conventional image tag in an html file or to an image control in an asp.net application.

An advanced image processing application is online at VicDemo, Multi-image Processing.

ASP.NET Source Code (VB)




Online Image Processing the ASP.NET source code

In this .net page we load an image, perform the image processing, and deliver it to the browser with a binary write. Requires Victor Image Processing Library for 32-bit Windows v 5.6 or higher.

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.catenary.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

Victor Image Processing Library homepage | Victor Product Summary | more source code




Copyright 2004-2005 Catenary Systems Inc. All rights reserved. Victor Image Processing Library is a trademark of Catenary Systems.