Sparkline.ToImage
Contents
[
Hide
]ToImage(ImageOrPrintOptions)
Converts a sparkline to an image.
public Bitmap ToImage(ImageOrPrintOptions options)
Parameter | Type | Description |
---|---|---|
options | ImageOrPrintOptions | The image options |
Return Value
Returns a Bitmap object.
See Also
- class ImageOrPrintOptions
- class Sparkline
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells
ToImage(string, ImageOrPrintOptions)
Converts a sparkline to an image.
public void ToImage(string fileName, ImageOrPrintOptions options)
Parameter | Type | Description |
---|---|---|
fileName | String | The image file name. |
options | ImageOrPrintOptions | The image options |
Examples
using System;
using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Rendering;
namespace AsposeCellsExamples
{
public class SparklineMethodToImageWithStringImageOrPrintOptionsDemo
{
public static void Run()
{
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Cells["A1"].PutValue(5);
sheet.Cells["B1"].PutValue(2);
sheet.Cells["C1"].PutValue(1);
sheet.Cells["D1"].PutValue(3);
CellArea ca = new CellArea
{
StartColumn = 4,
EndColumn = 4,
StartRow = 0,
EndRow = 0
};
int idx = sheet.SparklineGroups.Add(SparklineType.Line, sheet.Name + "!A1:D1", false, ca);
SparklineGroup group = sheet.SparklineGroups[idx];
Sparkline line = group.Sparklines[0];
ImageOrPrintOptions options = new ImageOrPrintOptions
{
ImageType = Aspose.Cells.Drawing.ImageType.Png,
HorizontalResolution = 300,
VerticalResolution = 300
};
line.ToImage("sparkline_output.png", options);
}
}
}
See Also
- class ImageOrPrintOptions
- class Sparkline
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells
ToImage(Stream, ImageOrPrintOptions)
Converts a sparkline to an image.
public void ToImage(Stream stream, ImageOrPrintOptions options)
Parameter | Type | Description |
---|---|---|
stream | Stream | The image stream. |
options | ImageOrPrintOptions | The image options. |
See Also
- class ImageOrPrintOptions
- class Sparkline
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells