Click here to Skip to main content
15,895,799 members
Articles / Web Development / ASP.NET

Applying a Color Wash to Images

Rate me:
Please Sign up or sign in to vote.
4.65/5 (18 votes)
15 Dec 2005CPOL7 min read 107.7K   1.1K   54  
This article demonstrates how to apply a color wash to images within .NET, complimenting what's possible with CSS.
Public Class ColorWash
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtColorWash As System.Web.UI.WebControls.TextBox
    Protected WithEvents btnColorWash As System.Web.UI.WebControls.Button
    Protected WithEvents btnGenImages As System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If Not IsPostBack Then
            If Not Request("RGB") = Nothing Then
                'Display value
                txtColorWash.Text = Request("RGB")

                'Generate images
                GavDev.Image.Manipulate.ColorWashImage(Server.MapPath("Images/Gav.jpg"), Server.MapPath("Images/Gav." & txtColorWash.Text & ".jpg"), txtColorWash.Text)
            End If
        End If

    End Sub

    Public Sub btnColorWash_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnColorWash.Click
        Response.Redirect("Default.aspx?RGB=" & txtColorWash.Text)
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
New Zealand New Zealand
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions