|
is this you want ?
void DisplayProperties()
{
CComPtr<ispecifypropertypages> pPages;
HRESULT hr = pCameraOutput->QueryInterface(IID_ISpecifyPropertyPages, (void**)&pPages);
if (SUCCEEDED(hr))
{
PIN_INFO PinInfo;
pCameraOutput->QueryPinInfo(&PinInfo);
CAUUID caGUID;
pPages->GetPages(&caGUID);
OleCreatePropertyFrame(
NULL,
0,
0,
L"Property Sheet",
1,
(IUnknown **)&(pCameraOutput),
caGUID.cElems,
caGUID.pElems,
0,
0,
NULL);
CoTaskMemFree(caGUID.pElems);
PinInfo.pFilter->Release();
}
}
|
|
|
|
|
Thanks for all the help so far, I just have one more issue that I'm having trouble working out. I want to save the captured image to a BMP file. I'm trying to write the Bitmap File Header (14 bytes) then the Bitmap Info Header(40 bytes) followed by the RGB image Bits. Is there and easy way to do this or do I have to write them one at a time!??? Right now I have around 18 or so WriteFile statements to do this but I'm not sure its going to work.
|
|
|
|
|
Here is the code that I added to ImageCapture to create the BMP file... However, there must be a way to avoid all of the WriteFile() commands. Any thaughts???
<br />
WriteFile(hFile,&bmType,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmFileSize,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmHeadBytes,sizeof(long),&dwWritten,NULL);<br />
<br />
WriteFile(hFile,&bmLongForty,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmXact,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmYdim,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmPlanes,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmBitsPixel,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmBytes,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmPPM,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmPPM,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
<br />
WriteFile(hFile, (LPCVOID)pImage , m_nFramelen, &dwWritten, 0);<br />
|
|
|
|
|
Finally I manged to comile the program.
Now it does not work.
1. Maybe because I have a 4 port card.
The card is "Grand X-Guard 4 port Digital Surveiiance System"
Do you know what do I have to do to make it work?
Shlomo
|
|
|
|
|
would you able to see the your device in that COMBO Box ?
in the above application available video capture devices/will display in combo box
|
|
|
|
|
Ok, so I added the following lines to the "strmif.h" file (at the top)
typedef int ULONG_PTR
typedef ULONG_PTR DWORD_PTR
typedef ULONG_PTR LONG_PTR
not all three files were compiled ok, but I receive the following 2 link errors:
unresolved external symbol _IID_IVMRWindowlessControl
unresolved external symbol _IID_IVMRFilterConfig
unresolved external symbol _CLSID_VideoMixingRendere
|
|
|
|
|
use the complete path for includes
and keep directx includes under "Tools->Option" Applet in the first place .
i think directX typedef's are clashing with some other includes/header files ..
R&D Researcher,
Seoul,Korea
|
|
|
|
|
|
I have the same error... My version is directx 9.0 (2004 Summer Update)... and I'm using Visual Studio 6... Also I found out that there are two "strmif.h" files... one in the visual studio C++ include directory and the other one in the directx directory... What am I to do?
|
|
|
|
|
Post your Error Here!!!
The first message in this thread have got 2 diferent kind of Errors .
One is due to DirectX version and Other is coz of DirectX Headers clashing with some other includes/header files
So pls Post your Error !!!I will try to help
|
|
|
|
|
I tried the solution given by the other guy of adding some statements to the "strmif.h" file... It's now working... My question now is how to open the file created by the ImageCapture function... since this is a topic off the thread, maybe you can just e-mail me... thanks!!! nice program by the way
|
|
|
|
|
if using BCB, add following statements:
const IID IID_IVMRFilterConfig = {0x9e5530c5,0x7034,0x48b4,{0xbb,0x46,0x0b,0x8a,0x6e,0xfc,0x8e,0x36}};
const IID IID_IVMRWindowlessControl = {0x0eb1088c,0x4dcd,0x46f0,{0x87,0x8f,0x39,0xda,0xe8,0x6a,0x51,0xb7}};
link with strmiids.lib in omf format.
Regards
Michal Pawluk
|
|
|
|
|
I added the DirectX and added the include files as the first line in Tools->Options->Directories.
No I receive two errors (* 3 files)
in the directx\include\strmif.h:
missing ';' before identifier 'MSEMAPHORE'
It looks like the DWORD_PTR is not defined
Shlomo
|
|
|
|
|
Please keep the "directX includes " in the first place
contact me at krssagar@firsteccom.co.kr for more help
|
|
|
|
|
I am trying to create an ActiveX control that will use DirectX to display a video preview and capture single frames for image processing. However, this is my first attempt at writing such a control. Can I use the InitalizeWindowlessVMR to display a preview image with out having an hWnd to a Dialog box... Or would I need to go about this some other way??? Thanks for the help!
_Flomp_
|
|
|
|
|
You can derive the ActiveX object from public CVMR_Capture,
and attach the handle
CVMR_Capture::Init (nDeviceId,this->m_hWndCD,nWidth,nHeight);
m_hWndCD is the handle to activex window ..
that will do the job and
for painting
HRESULT OnDrawAdvanced(ATL_DRAWINFO& di)
{
HRESULT hr;
RECT& rc = *(RECT*)di.prcBounds;
Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
if(pWC)
{
hr = pWC->RepaintVideo(m_hWndCD, di.hdcDraw);
}
}
YOu may follow this code
I am using ATL to create this control .
Hope this helps
|
|
|
|
|
Thanks, I am using MFC ActiveX and got another approach to work also. I created a Static Child Control in the Ctrl Class and passed its hWnd into Init(). This worked plus gives me a member variable rect to use for drawing. I can't stress enough how much help these classes have been for me!
|
|
|
|
|
I compiled the program and it runs fine with WindowsXP. However, under Windows2000, when I click the Init button, the following message came up The instruction at "0x004033c1" referenced memory at "0x00000000". The memory could not be "read". The author said the program works fine with Windows2000. What could be wrong? Thanks for your reply.
|
|
|
|
|
roland.zhu wrote:
I compiled the program and it runs fine with WindowsXP. However, under Windows2000, when I click the Init button, the following message came up The instruction at "0x004033c1" referenced memory at "0x00000000". The memory could not be "read". The author said the program works fine with
Windows2000. What could be wrong? Thanks for your reply.
Certainly the program works on Windows 2000 and XP ..
Check the version of DirectX you are using .
Start->Run
and type "dxdiag" you will see an applet which display the details fo DirectX installed in your machine.
you'll need to install the DirectX 9.0 SDK from Microsoft
R&D Researcher,
Seoul,Korea
|
|
|
|
|
I believe it is not working because windows 2000 does not support VMR7, it will only work on VMR9...
However, knowing this I tried editing the code to make it call VMR9 instead of VMR7 under windows 2000, the program still doesnt work. I am stuck on this but the class does work flawlessly under windows XP.
I am using this class to capture images from a webcam for my school 3d laser scanner project. So thanks Krssagar for all your help...
|
|
|
|
|
i developed and tested this application on windows 2000 only It works well ..
even i captured image For this article from a windows 2000 machine only.
i am not able to guess whats going wrong .
not sure but did you installed the service pack and all ?
gimme some clue we will try to sort it out ..
Thank you
|
|
|
|
|
hmm Actually i have no idea what was installed other than DX9SDK, since this was the schol's computer... The project is over now which is fine... the weird thing is when i change everythign to VMR9 by attaching the '9' to the end of things like VMR calls, a video shows up but not 'attached' to the window i wanted to put it in, and it wouldtn capture images properly.
thx anyways
|
|
|
|
|
I have the same problem!!
When I compiling, the problem is show in this line
->hr = m_pWC->SetVideoPosition(NULL,&rcDest);
What's wrong? Thanks for your reply.
|
|
|
|
|
I dunno whats wrong ...
can you pls send me the source code
i will check and let you know
|
|
|
|
|
The source code is download from this website.
Maybe this is my machine's problem.
Anyway, thank you very much. You're kind.
|
|
|
|
|