<?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[Platzhalter für jpg-Datei]]></title><description><![CDATA[<p>Hallihallo,</p>
<p>ich habe eine SDI-Anwendung mit einer Formview und möchte gerne in der View eine Art Platzhalter (zum Beispiel ein Steuerelement?) platzieren, an dessen Stelle zur Laufzeit ein Bild eingefügt wird. Das Bild einfügen klappt wunderbar, wenn ich die Ausdehnung der ganzen View nehme und an allen Seiten was abziehe, um das Bild dann in der Mitte anzuzeigen. Ich möchte aber eben irgendeinen Platzhalter, dessen Position ich bestimmen kann, um zu wissen, wo das Bild hinsoll. Bisher sieht mein Code folgendermaßen aus:</p>
<pre><code>void CEinzeltarife::OnDraw(CDC* pDC) 
{
        CPIcture m_tarifbild;
        m_tarifbild.Load(&quot;Bilder\\Bildchen.jpg&quot;);

	GetClientRect(&amp;m_ClientRect);
	m_tarifbild.UpdateSizeOnDC(pDC); // Get Picture Dimentions In Pixels
	m_tarifbild.Show(pDC, CRect(200, 200, m_ClientRect.right - 200, m_ClientRect.bottom - 200));
}
</code></pre>
<p>Mein Ansatz zur Lösung sah bisher folgendermaßen aus. Ich habe einfach eine Groupbox angelegt in der View und wollte nun auf dessen Koordinaten das Bild setzen.</p>
<pre><code>void CEinzeltarife::OnDraw(CDC* pDC) 
{
        CPicture m_tarifbild;
        m_tarifbild.Load(&quot;Bilder\\Bildchen.jpg&quot;);

	CStatic* platzhalterTarifbild = (CStatic*)this-&gt;GetDlgItem(IDC_PLATZHALTER); // ID vom Steuerelement GroupBox
	platzhalterTarifbild-&gt;CalcWindowRect(&amp;m_ClientRect, 0);

	m_tarifbild.UpdateSizeOnDC(pDC); // Get Picture Dimentions In Pixels
	m_tarifbild.Show(pDC, CRect(0, 0, m_ClientRect.right, m_ClientRect.bottom));
}
</code></pre>
<p>Wer kann mir helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/180950/platzhalter-für-jpg-datei</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 04:35:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180950.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 May 2007 14:29:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Platzhalter für jpg-Datei on Tue, 08 May 2007 14:29:17 GMT]]></title><description><![CDATA[<p>Hallihallo,</p>
<p>ich habe eine SDI-Anwendung mit einer Formview und möchte gerne in der View eine Art Platzhalter (zum Beispiel ein Steuerelement?) platzieren, an dessen Stelle zur Laufzeit ein Bild eingefügt wird. Das Bild einfügen klappt wunderbar, wenn ich die Ausdehnung der ganzen View nehme und an allen Seiten was abziehe, um das Bild dann in der Mitte anzuzeigen. Ich möchte aber eben irgendeinen Platzhalter, dessen Position ich bestimmen kann, um zu wissen, wo das Bild hinsoll. Bisher sieht mein Code folgendermaßen aus:</p>
<pre><code>void CEinzeltarife::OnDraw(CDC* pDC) 
{
        CPIcture m_tarifbild;
        m_tarifbild.Load(&quot;Bilder\\Bildchen.jpg&quot;);

	GetClientRect(&amp;m_ClientRect);
	m_tarifbild.UpdateSizeOnDC(pDC); // Get Picture Dimentions In Pixels
	m_tarifbild.Show(pDC, CRect(200, 200, m_ClientRect.right - 200, m_ClientRect.bottom - 200));
}
</code></pre>
<p>Mein Ansatz zur Lösung sah bisher folgendermaßen aus. Ich habe einfach eine Groupbox angelegt in der View und wollte nun auf dessen Koordinaten das Bild setzen.</p>
<pre><code>void CEinzeltarife::OnDraw(CDC* pDC) 
{
        CPicture m_tarifbild;
        m_tarifbild.Load(&quot;Bilder\\Bildchen.jpg&quot;);

	CStatic* platzhalterTarifbild = (CStatic*)this-&gt;GetDlgItem(IDC_PLATZHALTER); // ID vom Steuerelement GroupBox
	platzhalterTarifbild-&gt;CalcWindowRect(&amp;m_ClientRect, 0);

	m_tarifbild.UpdateSizeOnDC(pDC); // Get Picture Dimentions In Pixels
	m_tarifbild.Show(pDC, CRect(0, 0, m_ClientRect.right, m_ClientRect.bottom));
}
</code></pre>
<p>Wer kann mir helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1280952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1280952</guid><dc:creator><![CDATA[Lexaja]]></dc:creator><pubDate>Tue, 08 May 2007 14:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to Platzhalter für jpg-Datei on Tue, 08 May 2007 15:37:35 GMT]]></title><description><![CDATA[<p>Gibts nicht genau dafür die PictureControls? Schau mal im Resourceneditor, in der Toolbox.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1281002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1281002</guid><dc:creator><![CDATA[connan]]></dc:creator><pubDate>Tue, 08 May 2007 15:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to Platzhalter für jpg-Datei on Tue, 08 May 2007 22:18:45 GMT]]></title><description><![CDATA[<p>Damit kann man aber doch nur Bitmaps laden, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1281251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1281251</guid><dc:creator><![CDATA[Lexaja]]></dc:creator><pubDate>Tue, 08 May 2007 22:18:45 GMT</pubDate></item><item><title><![CDATA[Reply to Platzhalter für jpg-Datei on Wed, 09 May 2007 07:25:29 GMT]]></title><description><![CDATA[<p>Naja, das stimmt schon aber Du könntest ja dem PictureControl eine Variable spendieren (cstatic) und deine eigene Klasse von CStatic ableiten, dazu muss das Control aber eine andere ID als IDC_STATIC haben. Dann kannst du entwder per Hand blitten (OnPaint) oder du schaust mal nach WM_DRAWITEM bzw. ON_WM_DRAWITEM_REFLECT.</p>
<p>Dazu vieleicht das hier <a href="http://msdn2.microsoft.com/en-us/library/eeah46xd(VS.71).aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/eeah46xd(VS.71).aspx</a> mal durchschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1281331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1281331</guid><dc:creator><![CDATA[connan]]></dc:creator><pubDate>Wed, 09 May 2007 07:25:29 GMT</pubDate></item></channel></rss>