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


Glossary Item Box

Gets or sets the transparency color in the image.

Syntax

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

Property Value

Color object containing the transparency color

Example

This examples illustrates the setting of this property of an image cell type.
C#Copy Code
FarPoint.Win.Spread.CellType.ImageCellType icelltype =new FarPoint.Win.Spread.CellType.ImageCellType();
icelltype.Style = FarPoint.Win.RenderStyle.Stretch;
icelltype.TransparencyColor = Color.Black;
icelltype.TransparencyTolerance = 100;
fpSpread1.Sheets[0].Rows[0].CellType =icelltype;
System.Drawing.Image image = System.Drawing.Image.FromFile("D:\\alphaomega3.jpg"); 
System.IO.MemoryStream stream = new System.IO.MemoryStream();
byte[] bytes;
string str;
image.Save(stream,System.Drawing.Imaging.ImageFormat.Jpeg);
stream.Seek(0, System.IO.SeekOrigin.Begin); 
bytes = stream.GetBuffer();
str = System.Convert.ToBase64String(bytes);
fpSpread1.Sheets[0].Cells[0,0].Value = image;
fpSpread1.Sheets[0].Cells[0,1].Value = bytes;
fpSpread1.Sheets[0].Cells[0,2].Value = str;
Visual BasicCopy Code
Dim icelltype As New FarPoint.Win.Spread.CellType.ImageCellType
icelltype.Style = FarPoint.Win.RenderStyle.Stretch
icelltype.TransparencyColor = Color.Black
icelltype.TransparencyTolerance = 100
FpSpread1.Sheets(0).Rows(0).CellType = icelltype
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile("D:\alphaomega3.jpg")
Dim stream As New System.IO.MemoryStream
Dim bytes As Byte()
Dim str As String
image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg)
stream.Seek(0, System.IO.SeekOrigin.Begin)
bytes = stream.GetBuffer()
str = System.Convert.ToBase64String(bytes)
FpSpread1.Sheets(0).Cells(0, 0).Value = image
FpSpread1.Sheets(0).Cells(0, 1).Value = bytes
FpSpread1.Sheets(0).Cells(0, 2).Value = str

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.