2.2.4.46.3 Worksheet::AttachPicture

Description

Attach a picture, from an image file, to a worksheet cell.

Syntax

BOOL AttachPicture( int nRow, int nCol, LPCSTR lpcszFileName, DWORD dwEmbedInfo = 0 )

Parameters

nRow
[input] zero-based row index of the cell to attach the picture to
nCol
[input] zero-based column index of the cell to attach the picture to
lpcszFileName
[input] pointer to the picture's file name
dwEmbedInfo
[input] bits, including EMBEDGRAPH_KEEP_ASPECT_RATIO, EMBEDGRAPH_IN_LABELS, EMBEDGRAPH_NO_RESIZE_CELL

Return

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE.

Examples

EX1

//Attach a picture, from an image file, to a worksheet cell. 
void Worksheet_AttachPicture_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    
    string strImage = GetOpenBox("*.bmp");
    if(strImage.IsEmpty()) //user canceled
        return;
    
    wks.AttachPicture(0, 0, strImage);
}

Remark

See Also

Header to Include

origin.h