<?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[Transparentfarbe beim zeichnen von Bitmaps]]></title><description><![CDATA[<p>Hallo</p>
<p>Mein Problem ist folgendes: Mit der Funktion DrawIconEx kann man ja ein Icon auf einen DC zeichnen. Dabei werden ja die transparenten Stellen des Icons ausgelassen.</p>
<p>Nun möchte ich das gleiche mit einer Bitmap machen. Habe folgenden (bereits funktionierenden) Code:</p>
<pre><code class="language-cpp">bool DrawBitmapEx(HDC hDC, int iXPos, int iYPos, HBITMAP hbmpSrc, int iWidth, int iHeight, bool fAdaptImg)
{
	if(hDC == NULL || hbmpSrc == NULL)
		return (false);
	HDC hdcMem = CreateCompatibleDC(hDC);
	HBITMAP hbmpPrev = reinterpret_cast&lt;HBITMAP&gt;(SelectObject(hdcMem, hbmpSrc));
	if(fAdaptImg)
	{
		BITMAP bmInfo;
		GetObject(hbmpSrc, sizeof(BITMAP), &amp;bmInfo);
		StretchBlt(hDC, iXPos, iYPos, iWidth, iHeight, hdcMem, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, SRCCOPY);
	}
	else
		BitBlt(hDC, iXPos, iYPos, iWidth, iHeight, hdcMem, 0, 0, SRCCOPY);
	SelectObject(hdcMem, hbmpPrev);
	DeleteDC(hdcMem);
	return (true);
}
</code></pre>
<p>Habt ihr ne Idee wie ich die Transparenz mit rein bekomme (außer SetPixel + Schleifen :p ) ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/157162/transparentfarbe-beim-zeichnen-von-bitmaps</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 16:20:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/157162.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Aug 2006 16:23:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transparentfarbe beim zeichnen von Bitmaps on Wed, 23 Aug 2006 16:23:44 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Mein Problem ist folgendes: Mit der Funktion DrawIconEx kann man ja ein Icon auf einen DC zeichnen. Dabei werden ja die transparenten Stellen des Icons ausgelassen.</p>
<p>Nun möchte ich das gleiche mit einer Bitmap machen. Habe folgenden (bereits funktionierenden) Code:</p>
<pre><code class="language-cpp">bool DrawBitmapEx(HDC hDC, int iXPos, int iYPos, HBITMAP hbmpSrc, int iWidth, int iHeight, bool fAdaptImg)
{
	if(hDC == NULL || hbmpSrc == NULL)
		return (false);
	HDC hdcMem = CreateCompatibleDC(hDC);
	HBITMAP hbmpPrev = reinterpret_cast&lt;HBITMAP&gt;(SelectObject(hdcMem, hbmpSrc));
	if(fAdaptImg)
	{
		BITMAP bmInfo;
		GetObject(hbmpSrc, sizeof(BITMAP), &amp;bmInfo);
		StretchBlt(hDC, iXPos, iYPos, iWidth, iHeight, hdcMem, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, SRCCOPY);
	}
	else
		BitBlt(hDC, iXPos, iYPos, iWidth, iHeight, hdcMem, 0, 0, SRCCOPY);
	SelectObject(hdcMem, hbmpPrev);
	DeleteDC(hdcMem);
	return (true);
}
</code></pre>
<p>Habt ihr ne Idee wie ich die Transparenz mit rein bekomme (außer SetPixel + Schleifen :p ) ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1123030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1123030</guid><dc:creator><![CDATA[BYTE_BIT]]></dc:creator><pubDate>Wed, 23 Aug 2006 16:23:44 GMT</pubDate></item><item><title><![CDATA[Reply to Transparentfarbe beim zeichnen von Bitmaps on Wed, 23 Aug 2006 17:14:29 GMT]]></title><description><![CDATA[<p>google mal nach Bitmaske.<br />
Die sind Schwarzweiß und zeigen den GDI funktionen was gezeichnet werden soll und was nicht.</p>
<p>mfg tobZel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1123061</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1123061</guid><dc:creator><![CDATA[tobZel]]></dc:creator><pubDate>Wed, 23 Aug 2006 17:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to Transparentfarbe beim zeichnen von Bitmaps on Wed, 23 Aug 2006 18:03:04 GMT]]></title><description><![CDATA[<p>Es gibt TransparentBlt() und wenn du GDI+ nimmst, haste nicht nur einfache Transparenz zur Verfügung sondern sogar nen Alpha-Kanal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /></p>
<p>msdn-Remarks beachten:</p>
<blockquote>
<p>Windows 95/98: TransparentBlt contains a memory leak that can exhaust system resources. To draw a transparent bitmap using BitBlt, see Knowledge Base article 79212.</p>
</blockquote>
<p>Quellcode gibts also auch unter KB79212 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1123106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1123106</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Wed, 23 Aug 2006 18:03:04 GMT</pubDate></item><item><title><![CDATA[Reply to Transparentfarbe beim zeichnen von Bitmaps on Wed, 23 Aug 2006 22:41:11 GMT]]></title><description><![CDATA[<p>tobZel schrieb:</p>
<blockquote>
<p>[...]<br />
google mal nach Bitmaske.<br />
[...]</p>
</blockquote>
<p>Sind aber IMHO nicht für Bitmaps, sondern nur für Icons.</p>
<p>geeky schrieb:</p>
<blockquote>
<p>[...]</p>
<blockquote>
<p>Windows 95/98: TransparentBlt contains a memory leak that can exhaust system resources.[...]</p>
</blockquote>
<p>[...]</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> LOL <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1123293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1123293</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 23 Aug 2006 22:41:11 GMT</pubDate></item><item><title><![CDATA[Reply to Transparentfarbe beim zeichnen von Bitmaps on Thu, 24 Aug 2006 18:34:00 GMT]]></title><description><![CDATA[<p>Zum Zeichnen von Bitmaps mit einer transparenten Farbe, guck mal unter <a href="http://www.henkessoft.de/C++/MFC/mfc_einsteigerbuch_kapitel9.htm" rel="nofollow">www.henkessoft.de/C++/MFC/mfc_einsteigerbuch_kapitel9.htm</a>, da kommt das vor. Ist zwar mit MFC, aber die Vorgänge sind ja, was das Transparenzzeug betrifft, analog.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1124070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1124070</guid><dc:creator><![CDATA[NES-Spieler]]></dc:creator><pubDate>Thu, 24 Aug 2006 18:34:00 GMT</pubDate></item></channel></rss>