Spread Windows Forms 10.0 Product Documentation
ImageCellType Constructor(RenderStyle,Color,Int32)
Example 


Render style
Color to set as transparent
Amount of transparency tolerance from the transparent color
Creates a new image cell with the specified render style, transparency color, and tolerance.
Syntax
'Declaration
 
Public Function New( _
   ByVal style As RenderStyle, _
   ByVal transparencyColor As Color, _
   ByVal transparencyTolerance As Integer _
)
'Usage
 
Dim style As RenderStyle
Dim transparencyColor As Color
Dim transparencyTolerance As Integer
 
Dim instance As New ImageCellType(style, transparencyColor, transparencyTolerance)
public ImageCellType( 
   RenderStyle style,
   Color transparencyColor,
   int transparencyTolerance
)

Parameters

style
Render style
transparencyColor
Color to set as transparent
transparencyTolerance
Amount of transparency tolerance from the transparent color
Example
This example creates an image cell.
FarPoint.Win.Spread.CellType.ImageCellType icelltype =new FarPoint.Win.Spread.CellType.ImageCellType(FarPoint.Win.RenderStyle.Stretch,
Color.Black, 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;
Dim icelltype As New FarPoint.Win.Spread.CellType.ImageCellType(FarPoint.Win.RenderStyle.Stretch, Color.Black, 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 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ImageCellType Class
ImageCellType Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.