GraphPage::ExportMultiFrame

Description

Export a graph's flip-through images to a video or multi frame image.

Syntax

int ExportMultiFrame( LPCSTR pcszFileName, LPCSTR pcszType, int nWidth, int nHeight, LPVOID pOptions = NULL, LPVOID pFlipOpts = NULL )

Parameters

ArrangeLayersInfo
[input]arrange settings
pcszFileName
[input] pointer to the name of the destination file
pcszType
[input] pointer to the file type, "gif" or "tif" or "avi"
pOptions
[input] optional pointer to OGifOptions_t, OTiffOptions_t or OVideoOptions_t
pFlipOpts
[input] optional pointer to OFlipOptions_t

Return

0 if success

Examples

EX1

make black line browser plot with XYYY, and then run GraphPage_ExportMultiFrame_ex
#include <../Originlab/GraphicalExport.h>
void GraphPage_ExportMultiFrame_ex()
{
        GraphPage gp = Project.Pages();
        string strFileName = GetAppPath() + gp.GetName() + ".avi";
        
        double dWdith;
        RECT rect;
        compute_page_export_inch(gp, 1, dWdith, TRUE, &rect);
        int nDPI = 600;
        int width = (int)convert_size_to_specified_unit(dWdith, UNIT_INCH, UNIT_PIXEL, nDPI);
        int height = (int)round(RECT_HEIGHT(rect) * width / RECT_WIDTH(rect), DEFAULT_DECIMAL_PLACES);
        
        OVideoOptions_t vidOpts;
        vidOpts.nCodec = 0;
        vidOpts.dFPS = 1;
        
        LPVOID pOpts = NULL;
        pOpts = &vidOpts;
        
        OFlipOptions_t flip;
        flip.nShift = 1;
        
        int err = gp.ExportMultiFrame(strFileName, "avi", width, height, pOpts, &flip);
        if (err == 0)
                out_str(strFileName);
        else
                out_str("fail");
}

Remark

See Also

header to Include

origin.h