<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[reihenfolge bei video for windows und cap initialisierung]]></title><description><![CDATA[<p>Hallo,<br />
gibt es eine Reihenfolge bei der Verwendung von video for windows und diesen cap Funktionen bzw. Makros ?</p>
<p>Ich erstelle ein Fenster mit capCreateCaptureWindow<br />
mit capGetVideoFormat und capSetVideoFormat kann man die<br />
Größe ändern.</p>
<pre><code class="language-cpp">m_hwndCap = capCreateCaptureWindow(&quot;USB-Camera&quot;,WS_CHILD | WS_VISIBLE,rect.TopLeft().x,rect.TopLeft().y,rect.Width(),rect.Height(),m_ParentWindowHandle,999);
	capSetCallbackOnError(m_hwndCap, NULL);
	capSetCallbackOnStatus(m_hwndCap, NULL);   
	capSetCallbackOnVideoStream(m_hwndCap, NULL);
	capSetCallbackOnFrame(m_hwndCap, NULL); 
	capSetCallbackOnCapControl(m_hwndCap, NULL);		//?
	capSetCallbackOnWaveStream(m_hwndCap, NULL);
	capSetCallbackOnYield(m_hwndCap, NULL); 

    if(capDriverConnect(m_hwndCap,m_iDriverID) &amp;&amp; m_iDriverID &gt;= 0)
	{

		capSetCallbackOnFrame(m_hwndCap,lpFrameCallback);		
		capSetUserData(m_hwndCap,userData);

		//// set video format
		//DWORD dwSize;					
		//dwSize = capGetVideoFormatSize(m_hwndCap);
		//// allocate memory for bitmapinfo structure
		//m_lpbi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFO));		

		//capGetVideoFormat(m_hwndCap, m_lpbi, dwSize); 
		//m_lpbi-&gt;bmiHeader.biWidth =  640;//m_dwWidth;
		//m_lpbi-&gt;bmiHeader.biHeight = 480;//m_dwHeight;

		//capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);

		capPreviewRate(m_hwndCap,100);
		capPreview(m_hwndCap,TRUE);

		//// set video format
		DWORD dwSize;					
		dwSize = capGetVideoFormatSize(m_hwndCap);
		// allocate memory for bitmapinfo structure
		m_lpbi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFO));		

		capGetVideoFormat(m_hwndCap, m_lpbi, dwSize); 
		m_lpbi-&gt;bmiHeader.biWidth =  352;//m_dwWidth;
		m_lpbi-&gt;bmiHeader.biHeight = 288;//m_dwHeight;

		capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);
		capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);

		// free memory
		free(m_lpbi);
	}
	else 
	{
		::MessageBox(NULL,_T(&quot;Es ist ein Fehler aufgetreten&quot;),_T(&quot;Fehler&quot;),MB_OK);
		::DestroyWindow(m_hwndCap);
		return FALSE;
	}
</code></pre>
<p>Gibt es da eine Reihenfolge die zu beachten ist ? Wenn ich die Videogröße umstelle dann erscheint bei dem ersten Versuch nur ein schwazes FEnster.<br />
Starte ich dann zum zweiten mal Habe ich das Fenster in der gewünschten Größe.</p>
<p>Weiß jemand woran das liegt?<br />
Ich arbeite mit der MFC. Also das ist alles in einem Dialog eingebettet.</p>
<p>Grüße<br />
cmos</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205688/reihenfolge-bei-video-for-windows-und-cap-initialisierung</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 04:47:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205688.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Feb 2008 19:36:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to reihenfolge bei video for windows und cap initialisierung on Sat, 16 Feb 2008 19:36:43 GMT]]></title><description><![CDATA[<p>Hallo,<br />
gibt es eine Reihenfolge bei der Verwendung von video for windows und diesen cap Funktionen bzw. Makros ?</p>
<p>Ich erstelle ein Fenster mit capCreateCaptureWindow<br />
mit capGetVideoFormat und capSetVideoFormat kann man die<br />
Größe ändern.</p>
<pre><code class="language-cpp">m_hwndCap = capCreateCaptureWindow(&quot;USB-Camera&quot;,WS_CHILD | WS_VISIBLE,rect.TopLeft().x,rect.TopLeft().y,rect.Width(),rect.Height(),m_ParentWindowHandle,999);
	capSetCallbackOnError(m_hwndCap, NULL);
	capSetCallbackOnStatus(m_hwndCap, NULL);   
	capSetCallbackOnVideoStream(m_hwndCap, NULL);
	capSetCallbackOnFrame(m_hwndCap, NULL); 
	capSetCallbackOnCapControl(m_hwndCap, NULL);		//?
	capSetCallbackOnWaveStream(m_hwndCap, NULL);
	capSetCallbackOnYield(m_hwndCap, NULL); 

    if(capDriverConnect(m_hwndCap,m_iDriverID) &amp;&amp; m_iDriverID &gt;= 0)
	{

		capSetCallbackOnFrame(m_hwndCap,lpFrameCallback);		
		capSetUserData(m_hwndCap,userData);

		//// set video format
		//DWORD dwSize;					
		//dwSize = capGetVideoFormatSize(m_hwndCap);
		//// allocate memory for bitmapinfo structure
		//m_lpbi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFO));		

		//capGetVideoFormat(m_hwndCap, m_lpbi, dwSize); 
		//m_lpbi-&gt;bmiHeader.biWidth =  640;//m_dwWidth;
		//m_lpbi-&gt;bmiHeader.biHeight = 480;//m_dwHeight;

		//capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);

		capPreviewRate(m_hwndCap,100);
		capPreview(m_hwndCap,TRUE);

		//// set video format
		DWORD dwSize;					
		dwSize = capGetVideoFormatSize(m_hwndCap);
		// allocate memory for bitmapinfo structure
		m_lpbi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFO));		

		capGetVideoFormat(m_hwndCap, m_lpbi, dwSize); 
		m_lpbi-&gt;bmiHeader.biWidth =  352;//m_dwWidth;
		m_lpbi-&gt;bmiHeader.biHeight = 288;//m_dwHeight;

		capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);
		capSetVideoFormat(m_hwndCap,m_lpbi,dwSize);

		// free memory
		free(m_lpbi);
	}
	else 
	{
		::MessageBox(NULL,_T(&quot;Es ist ein Fehler aufgetreten&quot;),_T(&quot;Fehler&quot;),MB_OK);
		::DestroyWindow(m_hwndCap);
		return FALSE;
	}
</code></pre>
<p>Gibt es da eine Reihenfolge die zu beachten ist ? Wenn ich die Videogröße umstelle dann erscheint bei dem ersten Versuch nur ein schwazes FEnster.<br />
Starte ich dann zum zweiten mal Habe ich das Fenster in der gewünschten Größe.</p>
<p>Weiß jemand woran das liegt?<br />
Ich arbeite mit der MFC. Also das ist alles in einem Dialog eingebettet.</p>
<p>Grüße<br />
cmos</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1457244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1457244</guid><dc:creator><![CDATA[cmos]]></dc:creator><pubDate>Sat, 16 Feb 2008 19:36:43 GMT</pubDate></item></channel></rss>