Categories:

JavaScript Kit > IE Filters reference > Here

Engrave Filter

Last updated: October 27th, 2008

The Engrave filter shows a content as an engraved texture using grayscale values.

Syntax:

filter: progid:DXImageTransform.Microsoft.Engrave(attribute1=value1, attribute2=value2, etc);

Syntax (post IE8):

-ms-filter: "progid:DXImageTransform.Microsoft.Engrave(attribute1=value1, attribute2=value2, etc)";

Note: See "Difference in syntax between pre IE8 and IE8+ browsers" for more info on the changes to the filter syntax in IE8+.

Example:

<style type="text/css">

#somediv{
width: 90%;
-ms-filter: "progid:DXImageTransform.Microsoft.Engrave(enabled=true)";
filter: progid:DXImageTransform.Microsoft.Engrave(enabled=true);
}

</style>


<div id="somediv"><img src="test.gif" />Div with Text and Image</div>

Syntax via scripting:

//To define a new Engrave filter on an element
object.style.filter ="progid:DXImageTransform.Microsoft.Engrave(attribute=value1, attribute2=value2)"

To access an existing property within the Engrave filter:
object.filters.item("DXImageTransform.Microsoft.Engrave").Property1=value1;

//To access an existing property within the Engrave filter via the filters[] object
object.filters[x].Property1=value1 //where "x" is the position of the filter within list of filters on element

Below lists the attributes/properties of the Engrave filter:

Attributes/ Properties Description
Bias Sets/ returns a percentage of a value that is added to each color component of the filtered result. Practically, larger bias values create brighter filtered images. Default value is 0.7

Valid values: -1 to 1 (and in between)

enabled Sets/ returns whether the filter is enabled or not. Default is true.

Valid values: true/ false

Example:

<style type="text/css">

#dog{;
-ms-filter: "progid:DXImageTransform.Microsoft.Engrave(enabled=false)";
filter: progid:DXImageTransform.Microsoft.Engrave(enabled=false);
}

</style>

<img id="dog" src="dog.gif" />

<script type="text/javascript">
//Enable Engrave effect on image when the right time comes:
document.getElementById("dog").filters.item("DXImageTransform.Microsoft.Engrave").enabled=true
</script>

Demo (requires IE5.5+):

Reference List

[an error occurred while processing this directive]

CopyRight 1998-2014 JavaScript Kit. NO PART may be reproduced without author's permission.