imageComponent.NET title a curve
   Home Page | Blog | Online Forum | Links | SiteMap
Skip Navigation Links.
- Recommended .NET Book -

Programming Microsoft ADO.NET 2.0 Applications: Advanced Topics (Paperback)

Book Description Get in-depth coverage and expert insights on advanced ADO.NET programming topics s...[more]
Skip Navigation LinksHome > Products > PhotoController > Demo

Overview

This page demonstrates only some filters in PhotoController v1.x, which provides many other powerful functions to process image. It is strongly recommended to download the demo application to try all of them. The full source code is available for you.

Image Filters

Choose the filter in the dropdown list and click [Apply] button, you will see the below image processed by the specified filter.

   

Original Test Image



Code

The following C# source shows the code behinde of this demonstration. 


string filter = Request.QueryString["filter"].ToString();
int level = 20;
FilterStyle fs = FilterStyle.Sepia ;

switch (filter) {

     case "Sepia"
        { 
        fs = FilterStyle.Sepia; 
        level = 22; break
        } 
    case "ColorNoise"
        { 
        fs = FilterStyle.ColorNoise; 
        level = 20; break
        } 
    case "GaussianBlur"
        { 
        fs = FilterStyle.GaussianBlur; 
        level = 10; break
        } 
    case "Sharpen"
        { 
        fs = FilterStyle.Sharpen; 
        level = 3; break
        } 
    case "Water"
        { 
        fs = FilterStyle.Water; 
        level = 15; break
        } 
    case "Diffuse"
        { 
        fs = FilterStyle.Diffuse; 
        level = 10; break
        } 
    case "Mosaic"
        { 
        fs = FilterStyle.Mosaic; 
        level = 10; break
        }
}

Bitmap bm = new Bitmap(sample);
Filters filters = new Filters(fs, level);
Controller objPC = new Controller(bm);
Bitmap bitmap = new Bitmap( objPC.Filter(filters) );

objPC.Dispose();

MemoryStream oStream = new MemoryStream();
bitmap.Save(oStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.BinaryWrite(oStream.ToArray());
bm.Dispose();
bitmap.Dispose();
Response.End();



  Quick Search
Components
Books



Sponsors

  Home | Links | Blog | SiteMap | About | 2005-2007 © imageComponent.NET, All Rights Reserved.