<?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 wird nicht dargestellt ???]]></title><description><![CDATA[<p>Hi,</p>
<p>also ich hab mir meine Buttons selbst gebastelt.<br />
D.h. ich hab Bitmaps genommen, in meine Resourcen eingebunden und diese<br />
über ein Picture Control dargestellt.</p>
<p>Per WM_LBUTTONDOWN überprüfe ich ob mein Button gedrückt wurde.<br />
Soweit so gut, bisher gabs noch keine argen Probleme.</p>
<p>Ich bin nun mit dem OnMouseOver-Effect beschäfftigt. Ich will also wenn ich mit<br />
der Mouse über dem Bild bild das Bild neuzeichen.</p>
<p>Ich würde dazu am liebsten WM_MOUSEMOVE verwenden.</p>
<p>Das Board hab ich schon auf den Kopt gestellt wie man Bitmaps zeichnet. Schau auch garnicht schwer aus. Geht ja immer nach dem selben Schema.</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{	
	HDC hdc, hdcMem; 
    BITMAP bitmap; 
    PAINTSTRUCT ps; 
    static HBITMAP hbitmap; 
    static cxClient, cyClient;

.....

    if(Message==WM_INITDIALOG){
		SetDlgItemText(hwnd,IDC_EDIT_STATUS_BAR_LEFT,&quot;Ready&quot;);
		SendMessage(GetDlgItem(hwnd,IDC_CHECK_COMPRESS_WITH_UPX), BM_SETCHECK, BST_CHECKED, NULL);	

		hbitmap = (HBITMAP) LoadImage(hMainInstance, MAKEINTRESOURCE(IDB_BUTTON_NEW_OMO),IMAGE_BITMAP, NULL, NULL, NULL); 
		MessageBeep(NULL);
        GetObject(hbitmap, sizeof(BITMAP), &amp;bitmap); 
        cxClient = bitmap.bmWidth; 
        cyClient = bitmap.bmHeight; 

        if(hbitmap == NULL) 
            MessageBox(NULL, &quot;Error&quot;, NULL,NULL);

		return 0;	
    }//WM_INITDIALOG	

	else if(Message==WM_PAINT){		
		hdc = BeginPaint(hwnd, &amp;ps); 

        hdcMem = CreateCompatibleDC(hdc); 
        SelectObject(hdcMem, hbitmap); 

        BitBlt(hdc, 0,0, cxClient, cyClient,hdcMem,0,0, SRCCOPY); 

        DeleteDC(hdcMem);		
        EndPaint(hwnd, &amp;ps);		

		return 0;
	}
</code></pre>
<p>Ich denke mal das ich das Bitmap nun richtig zeichnen müsste, aber NEIN.<br />
Leider sehe ich garnichts. Wie man am Code sieht überprüfe ich ob mein Bitmap evtl. NULL ist. Fehlanzeige, das läd er anscheind korrekt.<br />
Auch wird der Paint-Event brav ausgelöst.</p>
<p>Warum wird mein Bitmap nicht gezeichnet.</p>
<p>Danke schonmal,</p>
<p>Gruß OHPen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75083/bitmap-wird-nicht-dargestellt</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 01:08:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75083.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 May 2004 10:56:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Thu, 27 May 2004 10:56:53 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also ich hab mir meine Buttons selbst gebastelt.<br />
D.h. ich hab Bitmaps genommen, in meine Resourcen eingebunden und diese<br />
über ein Picture Control dargestellt.</p>
<p>Per WM_LBUTTONDOWN überprüfe ich ob mein Button gedrückt wurde.<br />
Soweit so gut, bisher gabs noch keine argen Probleme.</p>
<p>Ich bin nun mit dem OnMouseOver-Effect beschäfftigt. Ich will also wenn ich mit<br />
der Mouse über dem Bild bild das Bild neuzeichen.</p>
<p>Ich würde dazu am liebsten WM_MOUSEMOVE verwenden.</p>
<p>Das Board hab ich schon auf den Kopt gestellt wie man Bitmaps zeichnet. Schau auch garnicht schwer aus. Geht ja immer nach dem selben Schema.</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{	
	HDC hdc, hdcMem; 
    BITMAP bitmap; 
    PAINTSTRUCT ps; 
    static HBITMAP hbitmap; 
    static cxClient, cyClient;

.....

    if(Message==WM_INITDIALOG){
		SetDlgItemText(hwnd,IDC_EDIT_STATUS_BAR_LEFT,&quot;Ready&quot;);
		SendMessage(GetDlgItem(hwnd,IDC_CHECK_COMPRESS_WITH_UPX), BM_SETCHECK, BST_CHECKED, NULL);	

		hbitmap = (HBITMAP) LoadImage(hMainInstance, MAKEINTRESOURCE(IDB_BUTTON_NEW_OMO),IMAGE_BITMAP, NULL, NULL, NULL); 
		MessageBeep(NULL);
        GetObject(hbitmap, sizeof(BITMAP), &amp;bitmap); 
        cxClient = bitmap.bmWidth; 
        cyClient = bitmap.bmHeight; 

        if(hbitmap == NULL) 
            MessageBox(NULL, &quot;Error&quot;, NULL,NULL);

		return 0;	
    }//WM_INITDIALOG	

	else if(Message==WM_PAINT){		
		hdc = BeginPaint(hwnd, &amp;ps); 

        hdcMem = CreateCompatibleDC(hdc); 
        SelectObject(hdcMem, hbitmap); 

        BitBlt(hdc, 0,0, cxClient, cyClient,hdcMem,0,0, SRCCOPY); 

        DeleteDC(hdcMem);		
        EndPaint(hwnd, &amp;ps);		

		return 0;
	}
</code></pre>
<p>Ich denke mal das ich das Bitmap nun richtig zeichnen müsste, aber NEIN.<br />
Leider sehe ich garnichts. Wie man am Code sieht überprüfe ich ob mein Bitmap evtl. NULL ist. Fehlanzeige, das läd er anscheind korrekt.<br />
Auch wird der Paint-Event brav ausgelöst.</p>
<p>Warum wird mein Bitmap nicht gezeichnet.</p>
<p>Danke schonmal,</p>
<p>Gruß OHPen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/528154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528154</guid><dc:creator><![CDATA[OHPen]]></dc:creator><pubDate>Thu, 27 May 2004 10:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Thu, 27 May 2004 13:19:20 GMT]]></title><description><![CDATA[<p>Bekommt man bei Dialogen auch WM_PAINT <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/528282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528282</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 27 May 2004 13:19:20 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Thu, 27 May 2004 15:33:19 GMT]]></title><description><![CDATA[<p>Die Message bekomme ich wenn ich z.B. das Fenster über den Bildschirmrand hinaus verschiebe oder ein anderes Fenster über mein Fenster ziehe.<br />
Dann wird immer neu gezeichnet, aber wieso wird mein Bitmap nicht gezeichnet !?</p>
<p>Hat keiner ne Idee ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/528328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528328</guid><dc:creator><![CDATA[OHPen]]></dc:creator><pubDate>Thu, 27 May 2004 15:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Thu, 27 May 2004 15:56:59 GMT]]></title><description><![CDATA[<p>Kann ich überhaupt in ein Picture Control malen, oder muss ich dem Control erst ein neues Bitmap zuweisen und dann das Fenster neuzeichenen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/528454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528454</guid><dc:creator><![CDATA[OHPen]]></dc:creator><pubDate>Thu, 27 May 2004 15:56:59 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Fri, 28 May 2004 08:39:02 GMT]]></title><description><![CDATA[<p>Picture Control <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> Ist das MFC oder VCL?!<br />
Außerdem zeichnest du doch direkt in das Fenster, oder sehe ich da was falsch? Ansonsten (wenn du schon ein spezielles Control dazu verwendest) überlass doch dem Picture Control die Arbeit <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=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/528785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528785</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 28 May 2004 08:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap wird nicht dargestellt ??? on Fri, 28 May 2004 12:24:43 GMT]]></title><description><![CDATA[<p>warum selektierst du die ganze zeit deine bitmap neu in ein hDC?<br />
könntest doch einfach einmal laden und dann immer draus zeichnen!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/528980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/528980</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 28 May 2004 12:24:43 GMT</pubDate></item></channel></rss>