filter - BasicImage() (Filter/visual)

Controls over the basic image display attributes of the containing HTML Element object.

Availability:

JScript - 5.5
Internet Explorer - 5.5
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.

Example code:

   <HTML>
   <HEAD>
   </HEAD>
   <BODY>
   Normal--&gt;
   <IMG ID="NORMAL" SRC="./Logo150.gif">
   X-Ray--&gt;
   <IMG ID="MYIMAGE" SRC="./Logo150.gif">
   <BR>
   <SCRIPT>
   myFilter = "progid:DXImageTransform.Microsoft.BasicImage(xray=1)";
   
   document.all.MYIMAGE.style.filter = myFilter;
   </SCRIPT>
   </BODY>
   </HTML>

See also:color value, filter - FlipH(), filter - FlipV(), filter - Grayscale(), filter - Invert(), filter - Mask(), filter - Matrix(), filter - XRay(), Filter object, style.filter

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
Enabled n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
GrayScale n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
Invert n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
Mask n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
MaskColor n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
Mirror n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
Opacity n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
Rotation n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-
XRay n/a5.5 5.5 n/a5.5 5.5 n/a n/a n/a n/a n/a n/a-