<?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[Bitmap löschen]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>der folgenden Quellcode dient zum Ausgeben von zwei Bitmaps(wobei IDI_ICON2<br />
über IDI_ICON1 liegt) in einem Fenster:</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;afxwin.h&gt;</p>
<p>class CMeinHauptfenster : public CFrameWnd {<br />
public:<br />
CMeinHauptfenster();<br />
protected:<br />
afx_msg void OnPaint();<br />
DECLARE_MESSAGE_MAP();</p>
<p>};<br />
CMeinHauptfenster::CMeinHauptfenster() {<br />
Create(NULL, &quot;&quot;,WS_SYSMENU, rectDefault);</p>
<p>};<br />
void CMeinHauptfenster::OnPaint() {</p>
<p>CBitmap *pMeinBild = new CBitmap;<br />
pMeinBild-&gt;LoadBitmap(IDI_ICON1);</p>
<p>BITMAP bm;<br />
CPaintDC dc(this);<br />
CDC MeinDC;<br />
MeinDC.CreateCompatibleDC(NULL);<br />
MeinDC.SelectObject(pMeinBild);<br />
pMeinBild-&gt;GetObject(sizeof(bm), &amp;bm);</p>
<p>dc.BitBlt(10,10, bm.bmWidth, bm.bmHeight, &amp;MeinDC,15,15,SRCCOPY);</p>
<p>CBitmap *pMeinBild2 = new CBitmap;<br />
pMeinBild2-&gt;LoadBitmap(IDI_ICON2);</p>
<p>BITMAP bm2;<br />
CPaintDC dc(this);<br />
CDC MeinDC2;<br />
MeinDC2.CreateCompatibleDC(NULL);<br />
MeinDC2.SelectObject(pMeinBild2);<br />
pMeinBild2-&gt;GetObject(sizeof(bm), &amp;bm);</p>
<p>dc.BitBlt(10,10, bm.bmWidth, bm.bmHeight, &amp;MeinDC2,15,15,SRCCOPY);<br />
}<br />
BEGIN_MESSAGE_MAP(CMeinHauptfenster,CFrameWnd)<br />
ON_WM_PAINT()<br />
END_MESSAGE_MAP()</p>
<p>class CMeineAnwendung : public CWinApp {<br />
public:<br />
virtual BOOL InitInstance();<br />
};</p>
<p>BOOL CMeineAnwendung::InitInstance() {<br />
m_pMainWnd = new CMeinHauptfenster();<br />
m_pMainWnd -&gt; ShowWindow(SW_SHOW);</p>
<p>return TRUE;<br />
}<br />
CMeineAnwendung Programm;</p>
<p>/////////////////////////////////////////////////////////////////////</p>
<p>Nun möchte ich gerne die zweite Bitmap(IDI_ICON2) über die Funktion<br />
InvalidateRect löschen, so das nur noch die erste Bitmap zu sehen ist.<br />
Aber InvalidateRect funktioniert nicht so richtig. Beim Kompilieren<br />
erscheinen dauernd Fehler. Wie müsste die Funktion konkret in meinem<br />
Beispiel aussehen?</p>
<p>Schon mal vielen Dank!</p>
<p>Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/47468/bitmap-löschen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 16:35:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/47468.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Aug 2003 18:41:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmap löschen on Fri, 29 Aug 2003 18:41:34 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>der folgenden Quellcode dient zum Ausgeben von zwei Bitmaps(wobei IDI_ICON2<br />
über IDI_ICON1 liegt) in einem Fenster:</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;afxwin.h&gt;</p>
<p>class CMeinHauptfenster : public CFrameWnd {<br />
public:<br />
CMeinHauptfenster();<br />
protected:<br />
afx_msg void OnPaint();<br />
DECLARE_MESSAGE_MAP();</p>
<p>};<br />
CMeinHauptfenster::CMeinHauptfenster() {<br />
Create(NULL, &quot;&quot;,WS_SYSMENU, rectDefault);</p>
<p>};<br />
void CMeinHauptfenster::OnPaint() {</p>
<p>CBitmap *pMeinBild = new CBitmap;<br />
pMeinBild-&gt;LoadBitmap(IDI_ICON1);</p>
<p>BITMAP bm;<br />
CPaintDC dc(this);<br />
CDC MeinDC;<br />
MeinDC.CreateCompatibleDC(NULL);<br />
MeinDC.SelectObject(pMeinBild);<br />
pMeinBild-&gt;GetObject(sizeof(bm), &amp;bm);</p>
<p>dc.BitBlt(10,10, bm.bmWidth, bm.bmHeight, &amp;MeinDC,15,15,SRCCOPY);</p>
<p>CBitmap *pMeinBild2 = new CBitmap;<br />
pMeinBild2-&gt;LoadBitmap(IDI_ICON2);</p>
<p>BITMAP bm2;<br />
CPaintDC dc(this);<br />
CDC MeinDC2;<br />
MeinDC2.CreateCompatibleDC(NULL);<br />
MeinDC2.SelectObject(pMeinBild2);<br />
pMeinBild2-&gt;GetObject(sizeof(bm), &amp;bm);</p>
<p>dc.BitBlt(10,10, bm.bmWidth, bm.bmHeight, &amp;MeinDC2,15,15,SRCCOPY);<br />
}<br />
BEGIN_MESSAGE_MAP(CMeinHauptfenster,CFrameWnd)<br />
ON_WM_PAINT()<br />
END_MESSAGE_MAP()</p>
<p>class CMeineAnwendung : public CWinApp {<br />
public:<br />
virtual BOOL InitInstance();<br />
};</p>
<p>BOOL CMeineAnwendung::InitInstance() {<br />
m_pMainWnd = new CMeinHauptfenster();<br />
m_pMainWnd -&gt; ShowWindow(SW_SHOW);</p>
<p>return TRUE;<br />
}<br />
CMeineAnwendung Programm;</p>
<p>/////////////////////////////////////////////////////////////////////</p>
<p>Nun möchte ich gerne die zweite Bitmap(IDI_ICON2) über die Funktion<br />
InvalidateRect löschen, so das nur noch die erste Bitmap zu sehen ist.<br />
Aber InvalidateRect funktioniert nicht so richtig. Beim Kompilieren<br />
erscheinen dauernd Fehler. Wie müsste die Funktion konkret in meinem<br />
Beispiel aussehen?</p>
<p>Schon mal vielen Dank!</p>
<p>Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343503</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Fri, 29 Aug 2003 18:41:34 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap löschen on Fri, 29 Aug 2003 20:54:32 GMT]]></title><description><![CDATA[<p>Ich kann nicht ganz nachvollziehen, warum du zuerst 2 Bitmaps übereinander legen möchtest, und dann 1 davon wieder löscht. Würde es nicht reichen, 1 Bitmap zu zeichnen und diese bei Bedarf einfach neu zu zeichnen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343576</guid><dc:creator><![CDATA[seppelina]]></dc:creator><pubDate>Fri, 29 Aug 2003 20:54:32 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap löschen on Sat, 30 Aug 2003 15:39:34 GMT]]></title><description><![CDATA[<p>Ich will einen Punkt(die eine Bitmap) über eine andere Bitmap wandern lassen.<br />
Natürlich könnte ich jetzt mehrere Bitmaps zeichnen und hintereinander anzeigen<br />
lassen. Aber erstens ist der Weg des Punktes vorher noch nicht bestimmt und zweitens wäre diese Möglichkeit nicht gerade professionel.</p>
<p>Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343910</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Sat, 30 Aug 2003 15:39:34 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap löschen on Sat, 30 Aug 2003 16:06:47 GMT]]></title><description><![CDATA[<p>Schau mal hier nach!</p>
<p><a href="http://www.henkessoft.de/mfc_einsteigerbuch_kapitel9.htm" rel="nofollow">http://www.henkessoft.de/mfc_einsteigerbuch_kapitel9.htm</a></p>
<p>hier wird ein &quot;Spiel&quot; programmiert mit der MFC (auf einem Dialog)!</p>
<p>So ca. in der mitte wird auch &quot;InvalidateRect(&amp;rect, FALSE);&quot; verwendet.</p>
<p>Schau´s dir einmal an. BYE, Sigi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343917</guid><dc:creator><![CDATA[BigSigi]]></dc:creator><pubDate>Sat, 30 Aug 2003 16:06:47 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap löschen on Mon, 01 Sep 2003 17:10:17 GMT]]></title><description><![CDATA[<p>Vielen Dank für die Antwort!</p>
<p>Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/345154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/345154</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Mon, 01 Sep 2003 17:10:17 GMT</pubDate></item></channel></rss>