Introduction
Overview
History
Advice
Books
Tutorials

Shapes
Summary
rect
roundrect
line
polyline
curve
arc
oval
image
shape

Special Topics
group
shapetype
positioning
animation
stylesheets

Community
Web Sites
Mailing Lists
USENET
Vendors
News

GBIC >> VML >> image
image Element
The image element is one of eight pre-defined shapes supplied by VML.

Before You Start image
Attributes


Return to top of document

Before You Start

Before you can use VML within MSIE, there are two lines of code which must be added to your web page. First, the normal <HTML> tag should be replaced with the following:

    <html xmlns:v="urn:schemas-microsoft-com:vml">

Also, the following line must be placed in the <HEAD> section of the web page:

    <style> v\:* { behavior: url(#default#VML); }</style >

These two tags enable MSIE to recognize and render VML tags, such as the simple rectangle VML tags we've seen so far. With these two lines entered, the core HTML code will look like:

    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <style> v\:* { behavior: url(#default#VML); }</style >
    </head>
    <body>
    </body>
    </html>


Return to top of document

image Element

The VML image element simplifies creating a basic shape, but if you want to create an entirely new shape, use the shape element.


Rectangle: <v:rect style="width:100;height:100" _
             fillcolor="red" strokecolor="blue"/>>


Return to top of document

Attributes

Like most of the pre-defined shapes, image element supports a standard, common core set of attributes. It has twelve custom attributes.

Common Attributes
adj A comma delimited list of numbers that are the parameters for the guide formulas that define the path of the shape. Values may be omitted to allow for using defaults. There can be up to 8 adjust values.
alt Alternative text associated with the shape.
class The CSS class of this shape
coordorigin The coordinates at the top-left corner of the containing block
coordsize The width and height of the coordinate space inside the containing block of this shape
fillcolor The color used to fill the path of this shape. The fill sub-element has a "color" attribute which will override this if specified
filled If set the path may be filled, if unset any fill specification on the path should be ignored
href The URL to jump to if the shape is clicked on
id A unique ID that identifies the shape. Used by scripts to reference the shape in a collection.
path A string containing the commands that define the path (see path element for definition of the command set)
strokecolor The primary color of the brush to use to stroke the path of this shape. The stroke sub-element has a "color" attribute which will override this if specified.
stroked If true, the path defining the shape will be stroked. By default, it will be stroked using a solid line unless there is a stroke sub-element which may specify more complex stroke properties. The stroke sub-element has an on attribute which will override this if specified.
strokeweight The width of the brush to use to stroke the path. The stroke sub-element has a "weight" attribute which will override this if specified.
style
target The target frame in a URL
title The title of the shape that may be displayed by editors
type A reference to a shapetype id that describes the standard path, fill and stroke properties of a shape.  Properties specified in the shape will override the shapetype properties.

Custom Attributes
bilevel Display picture in only two colors (usually black and white) using a function
blacklevel Allows adjustment to set the level so that blacks appear as true blacks, and all other colors are visible as shades above black.
chromakey Set a color of the input picture which will have an opacity of 0.  All other colors will have opacity 1.  This operation must be ignored if the picture already has an alpha channel.  If the picture is a PNG with tRNS chunk or a GIF with a transparent index then the chromakey is combined with that in the image - the chromakey will make any corresponding pixel completely transparent.
cropbottom Crop distance from edge of picture expressed as a fraction of picture size.
cropleft Crop distance from edge of picture expressed as a fraction of picture size.
cropright Crop distance from edge of picture expressed as a fraction of picture size.
croptop Crop distance from edge of picture expressed as a fraction of picture size.
embosscolor
gain Adjusts the intensity of all colors. Essentially sets how bright white will be.
gamma Gamma correction - a factor by which the intended target display gamma differs from from the sRGB profile, can be used to correct for images not prepared for sRGB displays and to adjust overall image contrast.  Decreasing it below 1 gives a more contrasty image.
grayscale Display picture in grayscale.  The user agent must calculate the ITU-R 709 luma (Y') value using the following formula for sRGB values in the range 0..255.
src URL to an image to load for image and pattern fills.