codeproject sf  找了老半天  不知道堆在哪一类里   
[email protected]

解决方案 »

  1.   

    抓图吗?
    参考:
    BOOL Snap(LPCTSTR strFile)
    {
    if (m_pBasicVideo)
    {
    long bitmapSize = 0;
    if (SUCCEEDED(m_pBasicVideo->GetCurrentImage(&bitmapSize, 0)))
    {
    bool pass = false;
    unsigned char * buffer = new unsigned char[bitmapSize];
    if (SUCCEEDED(m_pBasicVideo->GetCurrentImage(&bitmapSize, (long *)buffer)))
    {
    BITMAPFILEHEADER hdr;
    LPBITMAPINFOHEADER lpbi; lpbi = (LPBITMAPINFOHEADER)buffer; int nColors = 1 << lpbi->biBitCount;
    if (nColors > 256)
    nColors = 0; hdr.bfType = MAKEWORD('B','M'); //always is "BM"
    hdr.bfSize = bitmapSize + sizeof( hdr ) + sizeof(BITMAPINFOHEADER);;
    hdr.bfReserved1  = 0;
    hdr.bfReserved2  = 0;
    hdr.bfOffBits = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER); CFile bitmapFile(strFile, CFile::modeReadWrite | CFile::modeCreate | CFile::typeBinary);
    bitmapFile.Write(&hdr, sizeof(BITMAPFILEHEADER));
    bitmapFile.Write(buffer, bitmapSize);
    bitmapFile.Close();
    pass = true;
    }
    delete [] buffer;
    return pass;
    }
    }
    return false;
    }
      

  2.   

    DXSDK自己带的示例,你看了么?