Spread Windows Forms 6.0 Product Documentation
PictureTransparencyColor Property
See Also  Example Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : PictureTransparencyColor Property


Glossary Item Box

Gets or sets the transparency color for the picture in the edit control.

Syntax

Visual Basic (Declaration) 
Public Overrides Property PictureTransparencyColor As Color
Visual Basic (Usage)Copy Code
Dim instance As SuperEditBase
Dim value As Color
 
instance.PictureTransparencyColor = value
 
value = instance.PictureTransparencyColor
C# 
public override Color PictureTransparencyColor {get; set;}

Property Value

Color object containing the transparency color for a picture in the edit control

Remarks

In addition to displaying a picture in the content of the edit control, you can also display a foreground picture and a background picture. If you specify these pictures for a control, the control is painted as layers, with the foreground picture on top.

You can use the transparency colors feature of the various pictures to display portions of the underlying content and other pictures in the control. Set this property to specify the transparency color for the picture layer.

When you set a transparency color, the background behind the picture shows through the pictures in the area that originally had the color you specify. For example, if you specify yellow as the transparency color, areas in the picture that are yellow appear transparent, and the area behind them shows through the picture.

Note: If the computer is in 256-color mode and the control displays a picture and a foreground picture that have different palettes, the palette for the foreground picture will override the palette for the picture.

This property is available at run time only.

Tips

Specify the transparency color for the foreground and background pictures using the Picture class's TransparencyColor property.

Specify the picture for the picture layer by setting the Picture property.

You can also set the PictureMargin property to specify the margin to use between the picture and the text in the control.

Specify the orientation of the picture by setting the PictureOrientation property.

Example

This example shows the use of this property with related settings of text and a picture in the same control.
C#Copy Code
control.Text = "Alignment test";
control.Picture  = System.Drawing.Image.FromFile("d:\mail16A.ico")
control.PictureMargin = 25
control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate90;
control.PictureTransparencyColor = Color.Blue;
control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight;
control.TextOrientation = FarPoint.Win.TextOrientation.TextTopDown;
Visual BasicCopy Code
control.Text = "Alignment test"
control.Picture = System.Drawing.Image.FromFile("d:\mail16A.ico")
control.PictureMargin = 25
control.PictureOrientation = FarPoint.Win.PictureOrientation.PictureRotate90
control.PictureTransparencyColor = Color.Blue
control.AlignText = FarPoint.Win.TextAlign.TextLeftPictRight
control.TextOrientation = FarPoint.Win.TextOrientation.TextTopDown

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

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.