Xceed Chart for WinForms v4.4 Documentation
Image

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Fill Effects > Image

There are cases where you may want to map images created in other programs, such as Photoshop or Paintbrush, to your objects. For example, suppose that you are building a sales report Web site, which tracks the sales of four different companies. Instead of showing color bars for each company, you could decide to use the texture mapping features of the FillEffect object to assign an image representing the company logo to each bar. In addition, these logos may reside in different image formats, such as PNG or Bitmap. All this can be easily accomplished by using the SetImage function of the FillEffect object:

VB.NET  
fillEffect.SetImage("d:\winnt\zapotec.png")
C#  
fillEffect.SetImage("d:\\winnt\\zapotec.png");

The control will automatically detect the type of the image and import the texture from it. To set the properties modified by the SetImage function manually, you must use the following code:

VB.NET  

fillEffect.Type = FillEffectType.Image

fillEffect.ImageFileName = "d:\winnt\zapotec.png"

C#  

fillEffect.Type = FillEffectType.Image;

fillEffect.ImageFileName = "d:\\winnt\\zapotec.png";

Finally, you should also know that after you apply a texture, you can also modify the way it is mapped on the object. For a detailed description, please read the Texture Mapping topic in this book.

Related Examples

Windows Forms: Fill Effects\General

See Also

FillEffect | Xceed 3D Lighting Model | Working with Lights | Texture Mapping