<?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[Schon wieder: Probleme mit HBITMAP... =(]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will mit meinem Programm Bitmaps laden, aber soweit komme ich erst gar nicht: Ich schaffe es nichtmal, eine Bitmap darzustellen. Ich hab dasselbe Prinzip schonmal in nem älteren Projekt verwendet, aber auf einmal funktioniert es nicht mehr, und ich kann den Fehler einfach nicht finden:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{  
    static HDC DCmem, DCview;
    static HBITMAP Bitmap;

    switch (message)
    {
    case WM_INITDIALOG:

        DCmem  = CreateCompatibleDC (GetDC (HWND_DESKTOP));
        Bitmap  = CreateCompatibleBitmap (GetDC (HWND_DESKTOP), 100, 100);
        SelectObject (DCmem,  Bitmap);

        return 0;

    case WM_PAINT:
        Ellipse (DCmem, 10, 10, 90, 90);
        DCview = GetDC (hwnd);
        BitBlt (DCview, 0, 0, 100, 100, DCmem, 0, 0, SRCCOPY);
        ReleaseDC (hwnd, DCview);

        return 0 ;

    case WM_KEYDOWN:
        return 0;

    case WM_DESTROY:
        DeleteDC (DCmem);
        PostQuitMessage(0);
        return 0;
    }

    return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>Ich hab halt zwei DCs, auf den einen male ich nen Kreis, aber der BitBlt bringt es nicht raus, ich kann beim besten Willen keinen Kreis sehen, wenn ich direkt in DCview male klappt es... Bitte helft mir...</p>
<p>mfG D1B</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/72540/schon-wieder-probleme-mit-hbitmap</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 03:04:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/72540.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Apr 2004 17:19:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Thu, 29 Apr 2004 17:19:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will mit meinem Programm Bitmaps laden, aber soweit komme ich erst gar nicht: Ich schaffe es nichtmal, eine Bitmap darzustellen. Ich hab dasselbe Prinzip schonmal in nem älteren Projekt verwendet, aber auf einmal funktioniert es nicht mehr, und ich kann den Fehler einfach nicht finden:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{  
    static HDC DCmem, DCview;
    static HBITMAP Bitmap;

    switch (message)
    {
    case WM_INITDIALOG:

        DCmem  = CreateCompatibleDC (GetDC (HWND_DESKTOP));
        Bitmap  = CreateCompatibleBitmap (GetDC (HWND_DESKTOP), 100, 100);
        SelectObject (DCmem,  Bitmap);

        return 0;

    case WM_PAINT:
        Ellipse (DCmem, 10, 10, 90, 90);
        DCview = GetDC (hwnd);
        BitBlt (DCview, 0, 0, 100, 100, DCmem, 0, 0, SRCCOPY);
        ReleaseDC (hwnd, DCview);

        return 0 ;

    case WM_KEYDOWN:
        return 0;

    case WM_DESTROY:
        DeleteDC (DCmem);
        PostQuitMessage(0);
        return 0;
    }

    return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>Ich hab halt zwei DCs, auf den einen male ich nen Kreis, aber der BitBlt bringt es nicht raus, ich kann beim besten Willen keinen Kreis sehen, wenn ich direkt in DCview male klappt es... Bitte helft mir...</p>
<p>mfG D1B</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511312</guid><dc:creator><![CDATA[D1BAKEL]]></dc:creator><pubDate>Thu, 29 Apr 2004 17:19:50 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Thu, 29 Apr 2004 18:00:17 GMT]]></title><description><![CDATA[<p>Versuch mal mit BeginPaint und Endpaint zu arbeiten. Du vergisst übrigens in WM_DESTROY das Bitmap zu zerstören (sollte aber natürlich nicht die Ursache deines Problems sein).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511340</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Thu, 29 Apr 2004 18:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Thu, 29 Apr 2004 19:25:40 GMT]]></title><description><![CDATA[<p>Mich würd mal interessieren was du stattdessen siehst. Deine Bitmap, welche du in DCmem selektierst, ist ja quasi nicht initialisiert: Die könnte schwarz sein oder aber auch buntes Kuddelmuddel drin sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511390</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Thu, 29 Apr 2004 19:25:40 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Thu, 29 Apr 2004 20:32:29 GMT]]></title><description><![CDATA[<p>Das is ja eben das Problem, es wird gar nichts geblittet. Selbst wenn ich vorher DCmem mit BLACKNESS geblittet haette. Mit Begin- und EndPaint funktionierts auch nich...<br />
Ich will also foldendes: Die Datei &quot;bla.bmp&quot; soll bei WM_INITDIALOG in den DCmem geladen werden, sodass ich diesen dann bei WM_CREATE in mein Window blitten kann. Wie koennte das dann aussehen, wenn Bilder und Fenster die Aufloesung 400x300 haben???<br />
Ich schaffs einfach nich mehr, einen DC dazwischenzuschalten, direkt auf DCview kann ich mittels Ellipse, Rectangle etc. problemlos rumarbeiten, was aber mach ich mit den Bitmaps falsch???</p>
<p>mfG D1B</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511443</guid><dc:creator><![CDATA[D1BAKEL]]></dc:creator><pubDate>Thu, 29 Apr 2004 20:32:29 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Thu, 29 Apr 2004 21:17:21 GMT]]></title><description><![CDATA[<p>Bekommt man bei Dialogen überhaupt ein 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="😕"
    /><br />
Falls es kein Dialog ist solltest du aus WM_INITDIALOG (wird dann nämlich gar nicht gesendet) mal WM_CREATE machen <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/511474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511474</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 29 Apr 2004 21:17:21 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Fri, 30 Apr 2004 04:06:31 GMT]]></title><description><![CDATA[<p>Muss man nicht erstmal ein Farbstift und die Hintergrundtransparenz festlegen bevor man loszeichnet.... ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511511</guid><dc:creator><![CDATA[alpha one]]></dc:creator><pubDate>Fri, 30 Apr 2004 04:06:31 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Fri, 30 Apr 2004 11:36:12 GMT]]></title><description><![CDATA[<p>Naja, standardmäßig ist nen schwarzer Stift im DC. Problem wäre wenn die Bitmap selber schwarz wäre...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/511750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/511750</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Fri, 30 Apr 2004 11:36:12 GMT</pubDate></item><item><title><![CDATA[Reply to Schon wieder: Probleme mit HBITMAP... =( on Sun, 02 May 2004 20:33:25 GMT]]></title><description><![CDATA[<p>Muss am INITDIALOG liegen...schmeiß es in WM_CREATE...Namensgebung wäre auch unpraktisch wenns ein Dialog wäre, nicht WndProc sondern DlgProc <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/513118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/513118</guid><dc:creator><![CDATA[Surkevin]]></dc:creator><pubDate>Sun, 02 May 2004 20:33:25 GMT</pubDate></item></channel></rss>