Partager via


Décompression des données

[La fonctionnalité associée à cette page, Video Compression Manager, est une fonctionnalité héritée. Microsoft recommande vivement que le nouveau code n’utilise pas cette fonctionnalité.]

L’exemple suivant montre comment une application peut initialiser un décompresseur à l’aide de la macro ICDecompressBegin , décompresser une séquence d’images à l’aide de la fonction ICDecompress et arrêter la décompression à l’aide de la macro ICDecompressEnd .

LPBITMAPINFOHEADER lbpiIn, lpbiOut; 
LPVOID             lpIn, lpOut; 
LONG               lNumFrames, lFrameNum; 
 
// Assume lpbiIn and lpbiOut are initialized to the input and output 
// format and lpIn and lpOut are pointing to the buffers. 
if (ICDecompressBegin(hIC, lpbiIn, lpbiOut) == ICERR_OK)
{ 
    for (lFrameNum = 0; lFrameNum < lNumFrames, lFrameNum++)
    { 
        if (ICDecompress(hIC, 0, lpbiIn, lpIn, lpbiOut, 
            lpOut) == ICERR_OK) 
        { 
            // Frame decompressed OK so we can process it as required. 
        } 
        else 
        { 
            // Handle the decompression error that occurred. 
        } 
    } 
    ICDecompressEnd(hIC); 
} 
else 
{ 
    // Handle the error identifying an unsupported format. 
}