Xceed Chart for WinForms v4.4 Documentation
SetBitmap Method
Example 


Xceed.Chart.Standard.v4.4 Assembly > Xceed.Chart.Standard Namespace > FillEffect Class : SetBitmap Method
A Bitmap object containing the texture image
Use this function to apply a texture fill effect contained in a bitmap object. Note that this function will also change the current Mapping.
Syntax
'Declaration
 
Public Sub SetBitmap( _
   ByVal pBitmap As Bitmap _
) 
'Usage
 
Dim instance As FillEffect
Dim pBitmap As Bitmap
 
instance.SetBitmap(pBitmap)
public void SetBitmap( 
   Bitmap pBitmap
)

Parameters

pBitmap
A Bitmap object containing the texture image
Remarks
Use this function if you want to apply an image fill effect. The function will change the Type of the FillEffectBase to FillEffectType.Image. It will also replace the current FillEffectMapping object with a texture mapper with stretched layout type and object linear map mode. For more information see the topics under the "Fill Effects" book in the Users Guide.
Example
The following example applies an image extracted from resources to the chart background:
'load a texture for the background
Dim rm As ResourceManager =  New ResourceManager("SomeAssembly.AssemblyResources",GetType().Assembly) 
Dim mapping As FillEffectMapping =  New FillEffectMapping() 
mapping.TextureMapLayout = MapLay.Tiled

Dim bitmapTexture As Bitmap = CType((rm.GetObject("ImageNameInResources")), System.Drawing.Bitmap)
ChartControl1.Background.FillEffect.SetBitmap(bitmapTexture)
ChartControl1.Background.FillEffect.Mapping = mapping
//load a texture for the background
ResourceManager rm = new ResourceManager("SomeAssembly.AssemblyResources", GetType().Assembly);
FillEffectMapping mapping = new FillEffectMapping();
mapping.TextureMapLayout = MapLayout.Tiled;

Bitmap bitmapTexture = (System.Drawing.Bitmap)(rm.GetObject("ImageNameInResources"));
ChartControl1.Background.FillEffect.SetBitmap(bitmapTexture);
ChartControl1.Background.FillEffect.Mapping = mapping;
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FillEffect Class
FillEffect Members