2.2.4.17.23 GraphLayer::GetSparkline

Description

Get the sparkline into the PictureHolder

Syntax

bool GetSparkline( PictureHolder & phDest, LPCSTR lpcszType, int nRes, int nSpark, DWORD dwOptions )

Parameters

phDest
[output]the holder to put the image into.
lpcszType
the image type:
"Bitmap" // (Bitmap)
"EMF" // (Enhanced MetaFile, default)
"W" // (Windows Metafile)
"DIB" // (Device independent bitmap
nRes
additional info, like the resolution if bitmap.
nSpark
If >= 0, it is the index of the dataplot. If GPGETPICT_SPARKLINE_STYLE. Otherwise it should do all the dataplots and, if GPGETPICT_SPARKLINE_STYLE,
dwOptions
possible values (may combine):
EMBEDGRAPH_HIDE_AXES = 0x00000100, // hides Axes
EMBEDGRAPH_HIDE_LEGENDS = 0x00000200, // hides legends
EMBEDGRAPH_HIDE_SPECTRUMS = 0x00000400, // hides spectrums
EMBEDGRAPH_HIDE_TEXT_OBJS = 0x00000800, // hides texts
EMBEDGRAPH_SPARKLINE_LARGE = 0x00004000, // the copy in clipboard is larger than default
EMBEDGRAPH_SPARKLINE_CLIPBOARD = 0x00008000, // put a copy onto clipboard
EMBEDGRAPH_CACHE_IN_PAGE = 0x00100000, // cache image in page

Return

TRUE if succeed; FALSE otherwise

Examples

You need run the labtalk script first.

newbook;
string ascfile$ = System.path.program$ + "samples\Curve Fitting\Gaussian.dat";
ImpASC fname:= ascfile$;

//Get the sparkline into the PictureHolder.
void GraphLayer_GetSparkline_ex1()
{
	PictureHolder phDest;
	GraphPage        grPgSource = Project.GraphPages(0);
    if ( !grPgSource )
    {
        out_str("Invalid source page");
        return;
    }
 
    GraphLayer        grLaySource = grPgSource.Layers(0);
    if ( !grLaySource )
    {
        out_str("Invalid source layer");
        return;
    }
	grLaySource.GetSparkline(phDest, "EMF", 72, -1, EMBEDGRAPH_HIDE_LEGENDS); 
	// can display picutre holder on dialog by PictureControl::SetPicture
	
}

Remark

See Also

Header to Include

origin.h