<?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[Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren]]></title><description><![CDATA[<p>Ich habe in meiner Anwendung zwei CBitmap-Objekte. Eines enthält ein Bild was ich in meinem Dialogfeld zeichne.</p>
<p>Jetzt möchte ich das komplette Bild in ein anderes CBitmap-Objekt kopieren.</p>
<p>So in der Art wie:</p>
<pre><code class="language-cpp">CBitmap bObj1, bObj2;

// Bitmap in &quot;bObj1&quot; laden ...

bObj2 = bObj1;      // Geht leider nicht
</code></pre>
<p>ich meine nicht:</p>
<pre><code class="language-cpp">CBitmap bObj1, *bObj2;

bObj2 = &amp;bObj1;
</code></pre>
<p>Kann man das irgendwie hinkriegen ? Kenne leider keine geeigneten Funktionen für soetwas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169635/komplettes-bitmap-von-einem-cbitmap-objekt-in-anderes-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 03:46:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169635.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Jan 2007 11:35:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 11:35:18 GMT]]></title><description><![CDATA[<p>Ich habe in meiner Anwendung zwei CBitmap-Objekte. Eines enthält ein Bild was ich in meinem Dialogfeld zeichne.</p>
<p>Jetzt möchte ich das komplette Bild in ein anderes CBitmap-Objekt kopieren.</p>
<p>So in der Art wie:</p>
<pre><code class="language-cpp">CBitmap bObj1, bObj2;

// Bitmap in &quot;bObj1&quot; laden ...

bObj2 = bObj1;      // Geht leider nicht
</code></pre>
<p>ich meine nicht:</p>
<pre><code class="language-cpp">CBitmap bObj1, *bObj2;

bObj2 = &amp;bObj1;
</code></pre>
<p>Kann man das irgendwie hinkriegen ? Kenne leider keine geeigneten Funktionen für soetwas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1204885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204885</guid><dc:creator><![CDATA[Hmmmm..]]></dc:creator><pubDate>Sun, 07 Jan 2007 11:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 12:16:09 GMT]]></title><description><![CDATA[<p>ein einfacher Blick in die Hilfe bringt manchmal Wunder <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>
<pre><code class="language-cpp">CBitmap bObj1, bObj2;
BITMAP* copyBmp;

// irgendwas mit bObj1 machen
copyBmp = bObj1.GetBitmap(copyBmp);

// BITMAP Struktur in zweites Obj laden
bObj2.LoadBitmapIndirect(copyBmp);
</code></pre>
<p>zumindest müsste es etwa so gehen <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/1204901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204901</guid><dc:creator><![CDATA[schuri]]></dc:creator><pubDate>Sun, 07 Jan 2007 12:16:09 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 12:36:56 GMT]]></title><description><![CDATA[<p>danke erst mal.</p>
<p>da es LoadBitmapIndirect() nicht geibt, habe ich es mit CreateBitmapIndirect() ausprobiert, was aber auch fehlgeschlagen ist. mein code sieht so aus:</p>
<pre><code class="language-cpp">CBitmap	bBmp1, bBmp2;
	BITMAP	bBmpTmp; 

	// bBmp1 laden ...

	if (bBmp1.GetBitmap(bBmpTmp) != 0)
		bBmp2.CreateBitmapIndirect(bBmpTmp);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1204920</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204920</guid><dc:creator><![CDATA[Hmmmm..]]></dc:creator><pubDate>Sun, 07 Jan 2007 12:36:56 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 12:55:51 GMT]]></title><description><![CDATA[<p>CreateBitmapIndirect(..) ist richtig... da hatte ich mich verschrieben.<br />
Du musst aber die Variable bBmpTmp als Pointer benutzen.<br />
also:</p>
<pre><code class="language-cpp">BITMAP* bBmpTmp;
CBitmap    bBmp1, bBmp2;

// bBmp1 laden ...

if (bBmp1.GetBitmap(bBmpTmp) != 0)
    bBmp2.CreateBitmapIndirect(bBmpTmp);
</code></pre>
<p>oder</p>
<pre><code class="language-cpp">BITMAP     bBmpTmp;
CBitmap    bBmp1, bBmp2;

// bBmp1 laden ...

if (bBmp1.GetBitmap(&amp;bBmpTmp) != 0)
    bBmp2.CreateBitmapIndirect(&amp;bBmpTmp);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1204939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204939</guid><dc:creator><![CDATA[schuri]]></dc:creator><pubDate>Sun, 07 Jan 2007 12:55:51 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 13:32:43 GMT]]></title><description><![CDATA[<p>Ach ja, klar mit dem Pointer -.-</p>
<p>Aber es klappt leider nicht <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="😉"
    /><br />
Das neu Bitmap ist nur schwarz !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1204967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204967</guid><dc:creator><![CDATA[Hmmmm..]]></dc:creator><pubDate>Sun, 07 Jan 2007 13:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 18:42:38 GMT]]></title><description><![CDATA[<p>was genau willst du denn machen? willst du die bilder anzeigen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205170</guid><dc:creator><![CDATA[schuri]]></dc:creator><pubDate>Sun, 07 Jan 2007 18:42:38 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Sun, 07 Jan 2007 19:59:40 GMT]]></title><description><![CDATA[<p>Wie währe folgendes</p>
<pre><code class="language-cpp">BITMAP     bm;
	::GetObject(hBitmapSrc,sizeof(BITMAP), (LPSTR)&amp;bm);
DWORD *pPixels = (DWORD*)new BYTE[ bm.bmWidthBytes*bm.bmHeight ];
	LONG dwValue=::GetBitmapBits(hBitmapSrc,bm.bmWidthBytes*bm.bmHeight,pPixels);
	if(dwValue == bm.bmWidthBytes*bm.bmHeight)
	{
		CBitmap::CreateBitmap(bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel,pPixels);
	}
	delete pPixels;
</code></pre>
<p>ist zwar API aber sollte läßt sich mit wenig aufwand auf MFC (CBitmap) anpassen</p>
<p>Gruß Matthias</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205227</guid><dc:creator><![CDATA[CTecS]]></dc:creator><pubDate>Sun, 07 Jan 2007 19:59:40 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Mon, 08 Jan 2007 05:57:58 GMT]]></title><description><![CDATA[<p>danke, ist glaube ich eine gute lösung.</p>
<p>nur lässt sich das bitmap so nicht erstellen. ich vermute das ich noch etwas anderes machen muss.</p>
<p>bis in die klammer komme ich, das bitmap will ich so erzeugen:</p>
<pre><code class="language-cpp">CBitmap *bDragImage = new CBitmap();

        bDragImage-&gt;CreateBitmap(bm.bmWidth, bm.bmHeight, bm.bmPlanes, bm.bmBitsPixel, pPixels);
</code></pre>
<p>ich erhalte aber nur ein schwarzes bitmap !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205380</guid><dc:creator><![CDATA[Hhmmmm]]></dc:creator><pubDate>Mon, 08 Jan 2007 05:57:58 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Fri, 19 Jan 2007 11:35:34 GMT]]></title><description><![CDATA[<p>Mit folgendem code kann man ohne CDC eine kopie eines CBitmap-Objektes erzeugen:</p>
<p>CBitmap BitmapSrc<br />
//TODO: BitmapSrc Initialisierung (Z.b. Durch Überladung von CBitmap.Create())</p>
<p>BITMAP BitMap;</p>
<p>BitampSrc.GetBitmap(&amp;Bitmap);<br />
DWORD sz = Bitmap.bmHeight * Bitmap.bmWidthBytes;<br />
Bitmap.bmBits = malloc(sz);<br />
BitmapSrc.GetBitmapBits(sz, Bitmap.bmBits);</p>
<p>CBitmap BitmapCopy;<br />
bmp.CreateBitmapIndirect(&amp;Bitmap);</p>
<p>free(Bitmap.bmBits);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212579</guid><dc:creator><![CDATA[HarryMattes]]></dc:creator><pubDate>Fri, 19 Jan 2007 11:35:34 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Bitmap von einem CBitmap-Objekt in Anderes kopieren on Fri, 19 Jan 2007 11:38:26 GMT]]></title><description><![CDATA[<p>Mit folgendem code kann man ohne CDC eine kopie eines CBitmap-Objektes erzeugen:</p>
<p>CBitmap BitmapSrc<br />
//TODO: BitmapSrc Initialisierung (Z.b. Durch Überladung von CBitmap.Create())</p>
<p>BITMAP BitMap;</p>
<p>BitampSrc.GetBitmap(&amp;Bitmap);<br />
DWORD sz = Bitmap.bmHeight * Bitmap.bmWidthBytes;<br />
Bitmap.bmBits = malloc(sz);<br />
BitmapSrc.GetBitmapBits(sz, Bitmap.bmBits);</p>
<p>CBitmap BitmapCopy;<br />
BitmapCopy.CreateBitmapIndirect(&amp;Bitmap);</p>
<p>free(Bitmap.bmBits);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212582</guid><dc:creator><![CDATA[HarryMattes]]></dc:creator><pubDate>Fri, 19 Jan 2007 11:38:26 GMT</pubDate></item></channel></rss>