Availability: |
| |||
Object properties: | Enabled, GrayScale, Invert, Mask, MaskColor, Mirror, Opacity, Rotation, XRay | |||
Supported by objects: | A, ACRONYM, ADDRESS, B, BDO, BIG BLOCKQUOTE, body, BUTTON, CAPTION, CENTER, CITE, CODE, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAME, FRAMESET, Hn, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, MARQUEE, MENU, NOBR, OL, P, PLAINTEXT, PRE, Q, RT, RUBY, runtimeStyle, S, SAMP, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TD, TEXTAREA, TH, TT, U, UL, VAR, XMP |
This filter was added for version 5.5 of MSIE and consolidates the image handling capabilities of the filters in earlier versions of the MSIE browser.
The Enabled property turns the filter on and off by assigning the true or false value to it.
The GrayScale property replaces the functionality of the GrayScale() filter. Setting it to 1 discards the color information while zero makes it inactive.
The Invert property replaces the functionality of the Invert() filter. However, note that it inverts the value in the RGB color space and not the HSV color space that the deprecated Invert() filter used to use.
The Mask property replaces the functionality of the now deprecated Mask() filter. Any pixels set to transparent will be replaced by the color defined in the MaskColor operator. This means that MaskColor must be specified when the Mask operator is used.
The Mirror property replaces the deprecated FlipH() filter. The value 0 and 1 control whether the mirror effect is applied. To reproduce the effect of the FlipV() filter, use the Rotation operator first to rotate the element by 90 degrees.
The Opacity property can accept a floating point value between 0.0 and 1.0 (inclusive). 0.0 is completely transparent while 1.0 is completely opaque.
The Rotation property takes a set of values to specify which of of the four cardinal directions to rotate the object. The value 0 corresponds to no rotation. Angles of 90, 180 and 270 degrees are indicated by the values 1,2 and 3 respectively. This does not provide a free rotate facility. You can use it in combination with the mirroring to perform Mirror flips other than a straightforward left to right mirror.
The XRay property displays the image taking the average of the red and green values of each pixel and then inverting it. This is not quite the same as an invert on the GrayScale value. It is also different to what the earlier XRay() filter provided according to the documentation. Earlier XRay() filters were documented as proving just an edge detected outline.
The example shows an image in its normal and XRay modes.
<HTML> <HEAD> </HEAD> <BODY> Normal--> <IMG ID="NORMAL" SRC="./Logo150.gif"> X-Ray--> <IMG ID="MYIMAGE" SRC="./Logo150.gif"> <BR> <SCRIPT> myFilter = "progid:DXImageTransform.Microsoft.BasicImage(xray=1)"; document.all.MYIMAGE.style.filter = myFilter; </SCRIPT> </BODY> </HTML>
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
Enabled | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
GrayScale | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Invert | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Mask | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
MaskColor | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Mirror | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Opacity | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Rotation | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
XRay | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
filter - Barn() | Up | filter - BlendTrans() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |