C# Class SwfDotNet.IO.Tags.Types.BitmapFill

BitmapFill is used to fill a shape with an image.

Two type of bitmap fill are supported:

  • Clipped: If the area to be filled is larger than the image then the colour at the edge of the image is used to fill the remainder of the shape.
  • Tiled: If the area to be filled is larger than the image then the image is tiled across the area to be filled.

When an image is loaded its width and height default to twips rather than pixels. An image 300 x 200 pixels will be displayed as 300 x 200 twips (15 x 10 pixels). Scaling the image by 20 (20 twips = 1 pixel) using the Matrix object will restore it to its original size.

The image is drawn with the top left corner placed at the origin (0, 0) of the shape being filled. Depending on how the shape is drawn the coordinate transform may also need to specify a translation to place the image at the desired location.

When To Use ?

In addition to filling shapes with images that represent textures or complex fill patterns the BitmapFill class is required to display any image in a Flash file - image can only be displayed in Flash inside a shape definition. The classes that define images only contain the image data, not how it is displayed. To simply display an image, the selected line style of a shape may be set to zero so that the image is displayed without a border.

Inheritance: FillStyle
Afficher le fichier Open project: bladecoding/SwfExport

Méthodes publiques

Méthode Description
BitmapFill ( FillStyleType fillStyleType ) : System

Creates a new BitmapFill instance.

BitmapFill ( FillStyleType fillStyleType, ushort bitmapId, Matrix bitmapTransform ) : System

Creates a new BitmapFill instance.

BitmapFill ( byte fillStyleType ) : System

Creates a new BitmapFill instance.

BitmapFill ( byte fillStyleType, ushort bitmapId, Matrix bitmapTransform ) : System

Creates a new BitmapFill instance.

Serialize ( XmlWriter writer ) : void

Serializes the specified writer.

Method Details

BitmapFill() public méthode

Creates a new BitmapFill instance.
public BitmapFill ( FillStyleType fillStyleType ) : System
fillStyleType FillStyleType Fill style type.
Résultat System

BitmapFill() public méthode

Creates a new BitmapFill instance.
public BitmapFill ( FillStyleType fillStyleType, ushort bitmapId, Matrix bitmapTransform ) : System
fillStyleType FillStyleType Fill style type.
bitmapId ushort Bitmap id.
bitmapTransform Matrix Bitmap transform.
Résultat System

BitmapFill() public méthode

Creates a new BitmapFill instance.
public BitmapFill ( byte fillStyleType ) : System
fillStyleType byte Fill style type.
Résultat System

BitmapFill() public méthode

Creates a new BitmapFill instance.
public BitmapFill ( byte fillStyleType, ushort bitmapId, Matrix bitmapTransform ) : System
fillStyleType byte Fill style type.
bitmapId ushort Bitmap id.
bitmapTransform Matrix Bitmap transform.
Résultat System

Serialize() public méthode

Serializes the specified writer.
public Serialize ( XmlWriter writer ) : void
writer System.Xml.XmlWriter Writer.
Résultat void