标签:style color io os ar strong for sp log
}
void CTestDlg::OnPaused()
{
// TODO: Add your control notification handler code here
if(g_Current == Running)
{
if (SUCCEEDED(pimc->Pause()))
g_Current = Paused;
KillTimer(1);
}
// 释放所有接口
/* pimc->Release();
pimex->Release();
pigb->Release();
CoUninitialize();
*/
}
void CTestDlg::OnStop()
{
// TODO: Add your control notification handler code here
if((g_Current == Running)||(g_Current == Stopped))
{
hr = pimc->Stop();
KillTimer(1);
g_Current = Init;
pimc->Release();
pimex->Release();
pigb->Release();
CoUninitialize();
}
}
void CTestDlg::OnSetRate()
{
if (pims)
{
rate++;
if(rate==4)
{
rate=1;
}
pims->SetRate(rate);
CString str;
str.Format("快进>> X %d",rate);
(GetDlgItem(IDC_BUTTON2))->SetWindowText(str);
}
// pivw->GetCurrentImage(&lpCurrImage) ;
}
void CTestDlg::OnSavePic()
{
// TODO: Add your control notification handler code here
IBasicVideo *mBasicVideo = 0;
if (pigb)
{
pigb->QueryInterface(IID_IBasicVideo, (void **)&mBasicVideo);
}
if (mBasicVideo)
{
long bitmapSize = 0;
if (SUCCEEDED(mBasicVideo->GetCurrentImage(&bitmapSize, 0)))
{
bool pass = false;
unsigned char * buffer = new unsigned char[bitmapSize];
if (SUCCEEDED(mBasicVideo->GetCurrentImage(&bitmapSize, (long *)buffer)))
{
BITMAPFILEHEADER hdr;
LPBITMAPINFOHEADER lpbi;
lpbi = (LPBITMAPINFOHEADER)buffer;
int nColors = 1 << lpbi->biBitCount;
if (nColors > 256)
nColors = 0;
hdr.bfType = ((WORD) (‘M‘ << 8) | ‘B‘); //always is "BM"
hdr.bfSize = bitmapSize + sizeof( hdr );
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits = (DWORD) (sizeof(BITMAPFILEHEADER) + lpbi->biSize +
nColors * sizeof(RGBQUAD));
CFile bitmapFile("C:\\TEST.BMP", CFile::modeReadWrite | CFile::modeCreate | CFile::typeBinary);
bitmapFile.Write(&hdr, sizeof(BITMAPFILEHEADER));
bitmapFile.Write(buffer, bitmapSize);
bitmapFile.Close();
pass = true;
}
delete [] buffer;
WinExec("C:\\Program Files\\ACDSee\\ACDSee.exe C:\\TEST.BMP",SW_SHOW);
// return pass;
}
}
}
void CTestDlg::OnFullScreen()
{
// TODO: Add your control notification handler code here
if (pivw)
{
pivw->put_FullScreenMode(-1);
}
}
void CTestDlg::OnButton8() //属性
{
// TODO: Add your control notification handler code here
IEnumFilters* pEnum;
HRESULT hr ;
if (pigb)
{
hr = pigb-> EnumFilters(&pEnum);
if (FAILED(hr))
{
return ;
}
IBaseFilter* pFilter = NULL;
while (pEnum->Next(1, &pFilter, NULL) == S_OK)
{
// Check for required interface
IUnknown* pUnk;//查找Filter接口,只有一个?
HRESULT hrQuery = pFilter->QueryInterface(IID_IVideoWindow, (void**)&pUnk);
if (SUCCEEDED(hrQuery))
{
pUnk->Release();
pEnum->Release();
break ;
}
// pFilter->Release();
}
// pEnum->Release();
//
ISpecifyPropertyPages *pProp = NULL;//查询接口
hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pProp);
if (SUCCEEDED(hr))
{
// Get the filter‘s name and IUnknown pointer.
FILTER_INFO FilterInfo;
hr = pFilter->QueryFilterInfo(&FilterInfo);
IUnknown *pFilterUnk;
pFilter->QueryInterface(IID_IUnknown, (void **)&pFilterUnk);
//
CString str(FilterInfo.achName);//显示Filter名称
MessageBox(str);
// Show the page.
CAUUID caGUID;
pProp->GetPages(&caGUID);
pProp->Release();
OleCreatePropertyFrame(
this->GetSafeHwnd(), // Parent window
0, 0, // Reserved
FilterInfo.achName, //L"MAOMAO" // Caption for the dialog box
1, // Number of objects (just the filter)
&pFilterUnk, // Array of object pointers.
caGUID.cElems, // Number of property pages
caGUID.pElems, // Array of property page CLSIDs
0, // Locale identifier
0, NULL // Reserved
);
// Clean up.
pFilterUnk->Release();
FilterInfo.pGraph->Release();
CoTaskMemFree(caGUID.pElems);
}
}
}
标签:style color io os ar strong for sp log
原文地址:http://blog.csdn.net/mao0514/article/details/39429137