2.1.25.6 DeleteMetaFile


Description

deletes a metafile object

Syntax

BOOL DeleteMetaFile( HMETAFILE hMF )

Parameters

hMF
[input] a handle to a metafile object

Return

returns FALSE if fail else non zero.

Examples

EX1

int DeleteMetaFile_ex1()
{
    
    GraphPage gp;
    gp.Create("origin.otp");
    
    HMETAFILE hmf ;

    PictureHolder phDst;
    PictureHolder phCheckOwner;
    RECT rect;
    
    if(!gp.IsValid())
        return -1;
    else
    {
        Window gpWin = gp.GetWindow();
        gpWin.GetWindowRect(&rect);
        hmf = gp.CreateImage(CF_METAFILEPICT, 600,0);
        phDst.CreateFromMetafile( hmf, rect.right - rect.left, rect.bottom - rect.top , true);

        if(!phDst)
            out_str("Create fail");
    }
    DeleteMetaFile(hmf);
    
    
    if(phCheckOwner.CreateFromMetafile( hmf, rect.right - rect.left, rect.bottom - rect.top , true))
    {
        out_str("Error, hmf should be destroy of DeleteMetaFile.");
    }
    else
        out_str("work fine");
    return 1;
}

Remark

See Also

DeleteEnhMetaFile

Header to Include

origin.h

Reference