Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Implementing Filter Effect on an Image.

Author: DevASP
Download Source Code : 580_ImageFilter.zip

This article is about that how you can implement a filter effect on an image, making the mist angles change. The filter effect (Blur)in specific would be repeated every 2000 seconds.

Steps you will do.

 

Start visual studio and create a new web application.

 

Open the HTML design of your web page and add the following JavaScript functions before closing the head tag.

 

 

<SCRIPT LANGUAGE="JavaScript">

var Blur = new Array(0,45,90,135,180,255,270,315);

var BlurCounter = 0;

 

function EffectBlur()

{

 try

  {  

   if (BlurCounter == (Blur.length-1))

     BlurCounter = 0;

    else

    BlurCounter = BlurCounter + 1;

    document.all['imgFocus'].style.filter = "Blur(Add=1,Direction="+Blur[BlurCounter]+",Strength=240)";

    }

 catch(e)

      {

       alert(e.description);

      }

}

 

setInterval("EffectBlur()",2000);

 

</SCRIPT>

 

 

Now add the following HTML code to design the layout of your web page.

 

 

<BODY bgcolor=#009999>

<CENTER>

<IMG SRC="image.gif" ID="imgFocus" NAME="imgFocus" WIDTH="288" HEIGHT="238">

<h3>Dont forget to visit www.devasp.com<br>

<a href="http://www.devasp.com">www.devasp.com</a>

</h3>

</CENTER>

</BODY>

 

 

Note! To change the image to some else your own copy that into the root directory of the project and change the name in the HTML code.

 

Run your application and see the image effects.

 

 

 

Article Comments
Implementing Filter Effect on an Image

Posted on 4/6/2007 2:13:36 AM by Senthil Kumar

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Creating Multimedia Rollovers

Disclaimer - Privacy
© 2002-2017 DevASP.net