<?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[BitBlt funzt net]]></title><description><![CDATA[<p>Hi @ All.</p>
<p>ich habe folgenden code verwendet, um für Zehn sekunden das Bild zu blitten.</p>
<p>Das bild wird zuerst in einen kompatiblen dc zwischengespeichert, um es anschließend zurück auf die desktop-dc zu blitten.<br />
das funzt net.<br />
DAS SOLL KEIN ÄRGER_TOOL SEIN, SONDERN SINVOOLL.<br />
ich möchte nähmlich noch wenn es klappt, das bild nicht normal in hCache speichern, sonndern gespiegelt und verschwommen. aber das kommt später.</p>
<pre><code class="language-cpp">{
	DWORD dwMilliseconds = 10000;

	HDC hDC = GetDC(0);
	HDC hCache = CreateCompatibleDC(hDC);
	RECT rect; GetClientRect(GetDesktopWindow(),&amp;rect);

	BitBlt(hCache,
		0,0,
		rect.right-rect.left,rect.bottom-rect.top,
		hDC,
		rect.left,rect.top,
		SRCCOPY);

	DWORD dwStart,dwNow;

	dwStart = dwNow = GetTickCount();

	while ((dwNow - dwStart &lt;= dwMilliseconds) &amp;&amp; (dwStart &lt;= dwNow))
	{
		BitBlt(hDC,
			rect.left,rect.top,
			rect.right-rect.left,rect.bottom-rect.top,
			hCache,
			0,0,
			SRCCOPY);

		Beep(440,25);
		dwNow = GetTickCount();
	}

	DeleteObject(hCache);
}
</code></pre>
<p>was funzt dort net?<br />
thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/189341/bitblt-funzt-net</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 01:57:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/189341.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Aug 2007 16:19:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 16:19:28 GMT]]></title><description><![CDATA[<p>Hi @ All.</p>
<p>ich habe folgenden code verwendet, um für Zehn sekunden das Bild zu blitten.</p>
<p>Das bild wird zuerst in einen kompatiblen dc zwischengespeichert, um es anschließend zurück auf die desktop-dc zu blitten.<br />
das funzt net.<br />
DAS SOLL KEIN ÄRGER_TOOL SEIN, SONDERN SINVOOLL.<br />
ich möchte nähmlich noch wenn es klappt, das bild nicht normal in hCache speichern, sonndern gespiegelt und verschwommen. aber das kommt später.</p>
<pre><code class="language-cpp">{
	DWORD dwMilliseconds = 10000;

	HDC hDC = GetDC(0);
	HDC hCache = CreateCompatibleDC(hDC);
	RECT rect; GetClientRect(GetDesktopWindow(),&amp;rect);

	BitBlt(hCache,
		0,0,
		rect.right-rect.left,rect.bottom-rect.top,
		hDC,
		rect.left,rect.top,
		SRCCOPY);

	DWORD dwStart,dwNow;

	dwStart = dwNow = GetTickCount();

	while ((dwNow - dwStart &lt;= dwMilliseconds) &amp;&amp; (dwStart &lt;= dwNow))
	{
		BitBlt(hDC,
			rect.left,rect.top,
			rect.right-rect.left,rect.bottom-rect.top,
			hCache,
			0,0,
			SRCCOPY);

		Beep(440,25);
		dwNow = GetTickCount();
	}

	DeleteObject(hCache);
}
</code></pre>
<p>was funzt dort net?<br />
thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342796</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Sat, 11 Aug 2007 16:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 17:58:11 GMT]]></title><description><![CDATA[<p>In hCache ist keine Bitmap selektiert (bzw. nur die Standard 1x1 große Monochrom-Bitmap ;D)</p>
<p>Dein erstes BitBlt() blittet quasi nirgendswohin...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342868</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 11 Aug 2007 17:58:11 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 18:37:07 GMT]]></title><description><![CDATA[<p>ja aber ich habe ja gar kein bitmap, wo hin ich blitten möchte, sondern ich möchte doch nur ein Desktop-kontext in einem kompatiblen zurücklegen, um ihn später wieder zurückzublitten!</p>
<p>was mache ich denn da?</p>
<p>thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342886</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Sat, 11 Aug 2007 18:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 19:03:06 GMT]]></title><description><![CDATA[<p>Ne Bitmap erzeugen und rein-selektieren.</p>
<p>Ein Gerätekontext ist immer mit irgendner Zeichenfläche verbunden.<br />
Entweder direkt mit dem Display (GetDC() liefert z.B. solche) oder mit ner offscreen-Bitmap oder Drucker...</p>
<p>...CreateCompatibleDC() liefert ein DC mit einer 1x1 große Bitmap zurück.<br />
Erzeug mit CreateCompatibleBitmap() noch ne Bitmap deiner gewünschten Größe und selektier das in hCache mit SelectObject() danach sollte das klappen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342898</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342898</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 11 Aug 2007 19:03:06 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 19:40:08 GMT]]></title><description><![CDATA[<p>so, ich glaube, jetzt ist es korrekt:</p>
<pre><code class="language-cpp">{
	HDC hDC = GetDC(0);
	HDC hCache = CreateCompatibleDC(hDC);
	POINT pMouse; GetCursorPos(&amp;pMouse);
	RECT rect; GetClientRect(GetDesktopWindow(),&amp;rect);
	HBITMAP hBitmap = CreateCompatibleBitmap(hDC,rect.right-rect.left,rect.bottom-rect.top);

	SelectObject(hCache,hBitmap);

	for (int y = rect.top; y &lt;= rect.bottom; y++)
	{
		BitBlt(hCache,
			0,rect.bottom-rect.top-y,
			rect.right-rect.left,1,
			hDC,
			rect.left,y,
			SRCCOPY);
	}

	DWORD dwStart,dwNow;

	dwStart = dwNow = GetTickCount();

	while ((dwNow - dwStart &lt;= dwMilliseconds) &amp;&amp; (dwStart &lt;= dwNow))
	{
		BitBlt(hDC,
			rect.left,rect.top,
			rect.right-rect.left,rect.bottom-rect.top,
			hCache,
			0,0,
			SRCCOPY);

		SetCursorPos(pMouse.x,pMouse.y);
		Sleep(10);
		dwNow = GetTickCount();
	}

	InvalidateRect(NULL,NULL,TRUE);

	DeleteObject(hCache);
}
</code></pre>
<p>thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342924</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Sat, 11 Aug 2007 19:40:08 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 20:08:12 GMT]]></title><description><![CDATA[<p>also ich habe ja immer mit GetClientRect die Dimensionen ermittelt.<br />
aber kann man das nicht anhand des Devicekontext machen?<br />
Danke, dann wäre der Code erheblich sauberer.<br />
thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342933</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Sat, 11 Aug 2007 20:08:12 GMT</pubDate></item><item><title><![CDATA[Reply to BitBlt funzt net on Sat, 11 Aug 2007 20:18:08 GMT]]></title><description><![CDATA[<p>DC mit DeleteDC() löschen!<br />
Bitmaps, Pens, Brushes etc. mit DeleteObject.</p>
<p>Vor DeleteDC() sollte man rein-selektierte GDI-Objekte wieder raus-selektieren (in dem man das vorherige Objekt wieder rein-sektiert (Rückgabewerte von SelectObject!)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1342936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1342936</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 11 Aug 2007 20:18:08 GMT</pubDate></item></channel></rss>