<?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[Dialog OnPaint Picture Control]]></title><description><![CDATA[<p>Halle Zusammen,</p>
<p>ich habe wiedermal ein Problem <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>
<p>Ich habe einen Dialog in dem ich ein Bild anzeigen will (Picture Control).<br />
Sobald der Dialog aufgeht möchte ich das Bild schon sehen.</p>
<p>Nun ist es so, dass ich (beim debuggen) das Bild zwar sehe, und die restlichen Elemete (Editbox,...) nicht - aber sobald dann die OnPaint Methode aufgerufen wird, sehe ich alle Elemente des Dialogs, aber das Picture Control Bild wurde grau übermalt.</p>
<p>Ich habe eine Methode draw() welche mein Bild zeichnet.</p>
<pre><code class="language-cpp">BOOL OnInitDialog() 
{
  // ...
  draw();
}

void draw()
{
  //  ...
  CDC * pDC = m_pStatic-&gt;GetDC();  // Picture Control Static
  // ...
}
</code></pre>
<p>Ich ahbe auch schon das hier gefunden, hilft allerdings auch nichts</p>
<pre><code class="language-cpp">void OnPaint()
{
  CPaintDC dc(this); // device context for painting
  draw(&amp;dc);
}
void draw(CDC * pDC)
{
  //  ...
  // zeiche mit pDC
}
</code></pre>
<p>Bin dankbar für jeden tipp<br />
Danke schön :p</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188919/dialog-onpaint-picture-control</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 23:04:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188919.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Aug 2007 11:06:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dialog OnPaint Picture Control on Mon, 06 Aug 2007 11:06:15 GMT]]></title><description><![CDATA[<p>Halle Zusammen,</p>
<p>ich habe wiedermal ein Problem <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>
<p>Ich habe einen Dialog in dem ich ein Bild anzeigen will (Picture Control).<br />
Sobald der Dialog aufgeht möchte ich das Bild schon sehen.</p>
<p>Nun ist es so, dass ich (beim debuggen) das Bild zwar sehe, und die restlichen Elemete (Editbox,...) nicht - aber sobald dann die OnPaint Methode aufgerufen wird, sehe ich alle Elemente des Dialogs, aber das Picture Control Bild wurde grau übermalt.</p>
<p>Ich habe eine Methode draw() welche mein Bild zeichnet.</p>
<pre><code class="language-cpp">BOOL OnInitDialog() 
{
  // ...
  draw();
}

void draw()
{
  //  ...
  CDC * pDC = m_pStatic-&gt;GetDC();  // Picture Control Static
  // ...
}
</code></pre>
<p>Ich ahbe auch schon das hier gefunden, hilft allerdings auch nichts</p>
<pre><code class="language-cpp">void OnPaint()
{
  CPaintDC dc(this); // device context for painting
  draw(&amp;dc);
}
void draw(CDC * pDC)
{
  //  ...
  // zeiche mit pDC
}
</code></pre>
<p>Bin dankbar für jeden tipp<br />
Danke schön :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1339463</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1339463</guid><dc:creator><![CDATA[Lara*]]></dc:creator><pubDate>Mon, 06 Aug 2007 11:06:15 GMT</pubDate></item><item><title><![CDATA[Reply to Dialog OnPaint Picture Control on Mon, 06 Aug 2007 15:16:27 GMT]]></title><description><![CDATA[<p>Lässt du in OnInitDialog() den Dialog schon anzeigen, mit ShowWindow() oder ähnliches? Also bevor du draw() aufrufst? Weil der Dialog erst nach OnInitDialog() angezeigt wird. Die OnPaint() kannst du meiner Meinung nach komplett aus deinem Projekt entfernen. Das ist meiner Meinung nach veraltet.<br />
Ich würde das so machen:</p>
<p>- OnPaint() komplett entfernen<br />
- global const UINT WM_ON_APP_STARTUP = WM_APP + 1; deklarieren<br />
- in OnInitDialog() PostMessage(WM_ON_APP_STARTUP); hinzufügen<br />
- dann eine Fkt. OnAppStartup() bauen wo das Bild gezeichnet wird</p>
<p>so mach ich das meistens.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1339659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1339659</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 06 Aug 2007 15:16:27 GMT</pubDate></item></channel></rss>