<?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[Bild darstellen]]></title><description><![CDATA[<p>Hallo,<br />
ich wollte mit der lib cximage ein bild darstellen.</p>
<pre><code class="language-cpp">HBITMAP m_bitmap = NULL;
CxImage image(&quot;myfile.png&quot;, CXIMAGE_FORMAT_PNG);
...
CDC* hdc = m_picture.GetDC();
HBITMAP m_bitmap = image.MakeBitmap(hdc-&gt;m_hDC);

HBITMAP hOldBmp = m_picture.SetBitmap(m_bitmap);
if (hOldBmp) DeleteObject(hOldBmp);
if (hdc-&gt;m_hDC) m_picture.ReleaseDC(hdc);
...
if (m_bitmap) DeleteObject(m_bitmap);
</code></pre>
<p>Diesen Coder hier hab ich aus der Dokumentation.<br />
Leider ist CDC nicht deklariert( hab das mal in HDC umbennant)<br />
und m_picture auch nicht. Würde mich sehr freuen wenn einer weiß, was da falsch ist!<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/222780/bild-darstellen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 19:54:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222780.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Sep 2008 10:48:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 10:48:06 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich wollte mit der lib cximage ein bild darstellen.</p>
<pre><code class="language-cpp">HBITMAP m_bitmap = NULL;
CxImage image(&quot;myfile.png&quot;, CXIMAGE_FORMAT_PNG);
...
CDC* hdc = m_picture.GetDC();
HBITMAP m_bitmap = image.MakeBitmap(hdc-&gt;m_hDC);

HBITMAP hOldBmp = m_picture.SetBitmap(m_bitmap);
if (hOldBmp) DeleteObject(hOldBmp);
if (hdc-&gt;m_hDC) m_picture.ReleaseDC(hdc);
...
if (m_bitmap) DeleteObject(m_bitmap);
</code></pre>
<p>Diesen Coder hier hab ich aus der Dokumentation.<br />
Leider ist CDC nicht deklariert( hab das mal in HDC umbennant)<br />
und m_picture auch nicht. Würde mich sehr freuen wenn einer weiß, was da falsch ist!<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583409</guid><dc:creator><![CDATA[cximage]]></dc:creator><pubDate>Wed, 17 Sep 2008 10:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 11:24:56 GMT]]></title><description><![CDATA[<p>ich denke in diesem forum wird dir dabei keiner helfen können</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583434</guid><dc:creator><![CDATA[tobbb]]></dc:creator><pubDate>Wed, 17 Sep 2008 11:24:56 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 11:34:16 GMT]]></title><description><![CDATA[<p>CDC ist eine MFC-Klasse. Dazu müsstest du also ein MFC-Projekt erstellen, so dass die entsprechenden Header eingebunden sind. Wenn m_picture nicht deklariert wurde, hast du wohl die Deklaration vergessen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583441</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Wed, 17 Sep 2008 11:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 12:29:38 GMT]]></title><description><![CDATA[<p>danke, ich hab aber ein win32 projekt erstellt.<br />
Kann ich die nachträglich irgendwie dazutun?<br />
Oder muss ich ien neues MFC projekt starten?<br />
Wie deklariere ich den picture?<br />
Ich weiß ja nicht mal welche Variable das ist, weil sie im beispielcode nicht deklariert ist t.t</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583494</guid><dc:creator><![CDATA[cximage]]></dc:creator><pubDate>Wed, 17 Sep 2008 12:29:38 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 12:33:07 GMT]]></title><description><![CDATA[<p>cximage schrieb:</p>
<blockquote>
<p>danke, ich hab aber ein win32 projekt erstellt.<br />
Kann ich die nachträglich irgendwie dazutun?<br />
Oder muss ich ien neues MFC projekt starten?<br />
Wie deklariere ich den picture?<br />
Ich weiß ja nicht mal welche Variable das ist, weil sie im beispielcode nicht deklariert ist t.t</p>
</blockquote>
<p>Ja, starte ein MFC-Projekt!</p>
<p>Woher sollen wir das wissen? Könnte eine PictureBox (also CStatic) sein, die hat ne Methode SetBitmap. Könnte auch was ganz anderes sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583497</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Wed, 17 Sep 2008 12:33:07 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 12:44:25 GMT]]></title><description><![CDATA[<p>ich kann nicht ein neues Projekt starten dann muss ich mir ne lib suchen die kein MFC braucht. Kennt zufällig wer eine wo man jpgs darstellen kann?<br />
(will ned direkt winapi)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583513</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583513</guid><dc:creator><![CDATA[cximage]]></dc:creator><pubDate>Wed, 17 Sep 2008 12:44:25 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 12:52:22 GMT]]></title><description><![CDATA[<p>Dem von dir geposteten Code zufolge brauchst du doch gar keine MFC. Sie werden lediglich in dem Beispiel verwendet...</p>
<p>Mit Nachdenken kommt man da auch ohne MFC-Kenntnisse drauf (da könnten jetzt einige Fehler bei der Anzahl der Funktionsargumente sein, bin nicht mehr so bewandert damit):</p>
<pre><code class="language-cpp">HDC hDC = GetDC(hWnd); // irgendein DC, entweder durch GetDC, CreateDC oder BeginPaint bekommen...bei letzterem EndPaint nicht vergessen!

HBITMAP m_bitmap = NULL;
CxImage image(&quot;myfile.png&quot;, CXIMAGE_FORMAT_PNG);
...
// jetzt mach irgendwas mit der Bitmap... z.B. BitBlt 

// und freigeben
ReleaseDC(hWnd, hDC);
DeleteObject(m_bitmap);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1583520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583520</guid><dc:creator><![CDATA[Xantus]]></dc:creator><pubDate>Wed, 17 Sep 2008 12:52:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 13:32:03 GMT]]></title><description><![CDATA[<p>habs mal versucht geht aber nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title="=("
      alt="😞"
    /><br />
Hab erst das jpg in bmp umgewandelt(das geht) und dann versucht darzustellen:(aufm bildschirm)</p>
<pre><code class="language-cpp">CxImage image;
		image.Load(Filename.c_str(), CXIMAGE_FORMAT_JPG);
		if (image.IsValid()){
		image.Save(&quot;image.bmp&quot;,CXIMAGE_FORMAT_BMP);
		CxImage image1(&quot;image.bmp&quot;, CXIMAGE_FORMAT_BMP);
		HBITMAP m_bitmap = image1.MakeBitmap(0);
		HDC hdcMem = CreateCompatibleDC (hDC) ;
		SelectObject (hDC, m_bitmap) ;
		BitBlt(hDC, 0, 0, 1000, 1000, hdcMem, 0, 0, SRCCOPY);
</code></pre>
<p>geht aber ned <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title="=("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583589</guid><dc:creator><![CDATA[omg]]></dc:creator><pubDate>Wed, 17 Sep 2008 13:32:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 13:34:12 GMT]]></title><description><![CDATA[<p>omg schrieb:</p>
<blockquote>
<p>geht aber ned <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title="=("
      alt="😞"
    /></p>
</blockquote>
<p>Sehr präzise Fehlerbeschreibung! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583594</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Wed, 17 Sep 2008 13:34:12 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 13:34:36 GMT]]></title><description><![CDATA[<p>sry, es zeigt sich halt einfach kein Bild.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583595</guid><dc:creator><![CDATA[omg]]></dc:creator><pubDate>Wed, 17 Sep 2008 13:34:36 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 13:44:08 GMT]]></title><description><![CDATA[<p>hier noch wie ich den handle hole:</p>
<pre><code class="language-cpp">HDC hDC = GetDC(0); // irgendein DC, entweder durch GetDC, CreateDC oder BeginPaint bekommen...bei letzterem EndPaint nicht vergessen!
		CxImage image;
		image.Load(Filename.c_str(), CXIMAGE_FORMAT_JPG);
		if (image.IsValid()){
		image.Save(&quot;image.bmp&quot;,CXIMAGE_FORMAT_BMP);
		CxImage image1(&quot;image.bmp&quot;, CXIMAGE_FORMAT_BMP);
		HBITMAP m_bitmap = image1.MakeBitmap(0);
		HDC hdcMem = CreateCompatibleDC (hDC) ;
		SelectObject (hDC, m_bitmap) ;
		BitBlt(hDC, 0, 0, 1000, 1000, hdcMem, 0, 0, SRCCOPY);
		DeleteDC (hdcMem) ;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1583609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583609</guid><dc:creator><![CDATA[omg]]></dc:creator><pubDate>Wed, 17 Sep 2008 13:44:08 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 14:30:11 GMT]]></title><description><![CDATA[<p>habs jetzt nochma mit der WINAPI probiert!<br />
Der cximage teil funktioniert nur das darstellen nicht<br />
irgendwo muss ein fehler drin sein. das program erstellt ein fenster namens Dialog in das es dargestellt werden soll!</p>
<pre><code class="language-cpp">hDC = GetDC(FindWindow(0, &quot;Dialog&quot;)); // irgendein DC, entweder durch GetDC, CreateDC oder BeginPaint bekommen...bei letzterem EndPaint nicht vergessen!
		image.Load(Filename.c_str(), CXIMAGE_FORMAT_JPG);
		image.Save(&quot;image.bmp&quot;,CXIMAGE_FORMAT_BMP);
		hBmp = (HBITMAP)LoadImage(NULL,&quot;image.bmp&quot;,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
		SelectObject (hdcMem, hBmp) ;
		BitBlt(hDC, 0, 0, 200, 200, hDC, 0, 0, SRCCOPY);
		DeleteDC (hdcMem) ;
		ReleaseDC(0, hDC);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1583649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583649</guid><dc:creator><![CDATA[omg]]></dc:creator><pubDate>Wed, 17 Sep 2008 14:30:11 GMT</pubDate></item><item><title><![CDATA[Reply to Bild darstellen on Wed, 17 Sep 2008 18:32:27 GMT]]></title><description><![CDATA[<p>CreateCompatibleDC()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1583831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1583831</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 17 Sep 2008 18:32:27 GMT</pubDate></item></channel></rss>