<?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 an Button anpassen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem.<br />
Ich möchte auf meinen Button ein Bitmap aus einer Datei laden und dieses Bitmap an die Größe des Button anpassen. Mein Code sieht wie folgt aus, aber aus irgendeinem Grund werden die Werte nicht übernommen.</p>
<pre><code class="language-cpp">CRect rect;
m_btButton1.GetClientRect(&amp;rect);
rect.NormalizeRect();
int breite = rect.Width();
int hoehe = rect.Height();
SIZE sizeRect;
BOOL success = SetBitmapDimensionEx(hBitmap, breite, hoehe, &amp;sizeRect);
int nWidth = sizeRect.cx;
int nHeight = sizeRect.cy;
if(success)
  MessageBeep(0xFFFFFFFF);
m_bmpBuffer.Attach(hBitmap); 
BITMAP bm;
m_bmpBuffer.GetBitmap(&amp;bm);
m_strDisplayText.Format(&quot;%i%i&quot;, bm.bmWidth, bm.bmHeight);
m_btButton1.SetBitmap(m_bmpBuffer);
UpdateData(FALSE);
Invalidate();
</code></pre>
<p>Könnt ihr mir sagen woran das liegt? Muss ich vielleicht mit einem Gerätekontext arbeiten?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/45490/bitmap-an-button-anpassen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 02:37:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/45490.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Aug 2003 07:37:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmap an Button anpassen on Mon, 11 Aug 2003 07:37:17 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem.<br />
Ich möchte auf meinen Button ein Bitmap aus einer Datei laden und dieses Bitmap an die Größe des Button anpassen. Mein Code sieht wie folgt aus, aber aus irgendeinem Grund werden die Werte nicht übernommen.</p>
<pre><code class="language-cpp">CRect rect;
m_btButton1.GetClientRect(&amp;rect);
rect.NormalizeRect();
int breite = rect.Width();
int hoehe = rect.Height();
SIZE sizeRect;
BOOL success = SetBitmapDimensionEx(hBitmap, breite, hoehe, &amp;sizeRect);
int nWidth = sizeRect.cx;
int nHeight = sizeRect.cy;
if(success)
  MessageBeep(0xFFFFFFFF);
m_bmpBuffer.Attach(hBitmap); 
BITMAP bm;
m_bmpBuffer.GetBitmap(&amp;bm);
m_strDisplayText.Format(&quot;%i%i&quot;, bm.bmWidth, bm.bmHeight);
m_btButton1.SetBitmap(m_bmpBuffer);
UpdateData(FALSE);
Invalidate();
</code></pre>
<p>Könnt ihr mir sagen woran das liegt? Muss ich vielleicht mit einem Gerätekontext arbeiten?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/328952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/328952</guid><dc:creator><![CDATA[Student]]></dc:creator><pubDate>Mon, 11 Aug 2003 07:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap an Button anpassen on Tue, 12 Aug 2003 11:28:24 GMT]]></title><description><![CDATA[<blockquote>
<p>&gt; SetBitmapDimensionEx</p>
</blockquote>
<p>Nur aufgrund dessen, dass du das Massband verlängerst, ändert sich doch noch lange nicht die Länge des gemessenen Objekts. &gt;&gt; StretchBlt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/330032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/330032</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Tue, 12 Aug 2003 11:28:24 GMT</pubDate></item></channel></rss>