<?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[Paint- Funktion]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich sitze gerade noch an einem C-Projekt als Windowsprogramm, in dem sich Punkte über den Bildschirm bewegen sollen. Ich soll hier die Timer- mit der Paint- Funtion kombinieren.</p>
<p>Um eine Beliebige Anzahl von Punkten mit den gleichen Bewegungsformeln darzustellen will ich je Timersignal eine for-schleife ablaufen lassen.</p>
<p>Jetzt mein Problem:<br />
Am ende der for-schleife steht mein unterprogramm, das die werte in eine grafik umwandelt. allerdings bleibt im endeffekt nur das bild des letzten durchlaufs der for- schleife stehen. Wie kann ich denn verhindern, dass er bei jedem durchlauf des zeichen unterprogrammes den bildschirm erst löscht?</p>
<p>Hier noch der Quelltext:</p>
<p>case WM_TIMER:<br />
switch (wParam)<br />
{<br />
case IDT_TIMER1:</p>
<p>t=t+0.1;<br />
xa = (xbeschl<em>t);<br />
ya = (ybeschl</em>t);</p>
<p>for (i=1; i&lt;=anzahl; i++)<br />
{<br />
xres = x[i]+xa;<br />
start_xl_a[i] = start_xl_a[i]+xres;<br />
start_xl[i] = round(start_xl_a[i]);</p>
<p>yres = y[i]+ya;<br />
start_yo_a[i] = start_yo_a[i]+yres;<br />
start_yo[i] = round(start_yo_a[i]);</p>
<p>zeichnen (hwnd, &amp;start_xl[i] , &amp;start_yo[i]);<br />
}</p>
<p>Zeichenprogramm:</p>
<p>BOOL zeichnen (HWND hwnd, int *start_xl, int *start_yo)//, int xr, int yo )<br />
{<br />
int ScreenColor;<br />
int xl,yo;</p>
<p>HDC hdc ;<br />
PAINTSTRUCT ps ;<br />
RECT Rect ;</p>
<p>InvalidateRect (hwnd, NULL, TRUE) ;<br />
hdc = BeginPaint (hwnd, &amp;ps) ;<br />
SetBkMode(hdc, TRANSPARENT);</p>
<p>ScreenColor = RGB(0, 0, 255);<br />
SelectBrush(hdc, CreateSolidBrush(ScreenColor));</p>
<p>xl=*start_xl;<br />
yo=*start_yo;</p>
<p>Ellipse(hdc, (xl), (yo), (xl+8), (yo+8));</p>
<p>EndPaint (hwnd, &amp;ps) ;<br />
UpdateWindow(hwnd);<br />
return 1;<br />
}</p>
<p>Vielen Dank schon im Vorraus, für eure Hilfe!</p>
<p>Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/150875/paint-funktion</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 17:13:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150875.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Jun 2006 08:07:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 08:07:48 GMT]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich sitze gerade noch an einem C-Projekt als Windowsprogramm, in dem sich Punkte über den Bildschirm bewegen sollen. Ich soll hier die Timer- mit der Paint- Funtion kombinieren.</p>
<p>Um eine Beliebige Anzahl von Punkten mit den gleichen Bewegungsformeln darzustellen will ich je Timersignal eine for-schleife ablaufen lassen.</p>
<p>Jetzt mein Problem:<br />
Am ende der for-schleife steht mein unterprogramm, das die werte in eine grafik umwandelt. allerdings bleibt im endeffekt nur das bild des letzten durchlaufs der for- schleife stehen. Wie kann ich denn verhindern, dass er bei jedem durchlauf des zeichen unterprogrammes den bildschirm erst löscht?</p>
<p>Hier noch der Quelltext:</p>
<p>case WM_TIMER:<br />
switch (wParam)<br />
{<br />
case IDT_TIMER1:</p>
<p>t=t+0.1;<br />
xa = (xbeschl<em>t);<br />
ya = (ybeschl</em>t);</p>
<p>for (i=1; i&lt;=anzahl; i++)<br />
{<br />
xres = x[i]+xa;<br />
start_xl_a[i] = start_xl_a[i]+xres;<br />
start_xl[i] = round(start_xl_a[i]);</p>
<p>yres = y[i]+ya;<br />
start_yo_a[i] = start_yo_a[i]+yres;<br />
start_yo[i] = round(start_yo_a[i]);</p>
<p>zeichnen (hwnd, &amp;start_xl[i] , &amp;start_yo[i]);<br />
}</p>
<p>Zeichenprogramm:</p>
<p>BOOL zeichnen (HWND hwnd, int *start_xl, int *start_yo)//, int xr, int yo )<br />
{<br />
int ScreenColor;<br />
int xl,yo;</p>
<p>HDC hdc ;<br />
PAINTSTRUCT ps ;<br />
RECT Rect ;</p>
<p>InvalidateRect (hwnd, NULL, TRUE) ;<br />
hdc = BeginPaint (hwnd, &amp;ps) ;<br />
SetBkMode(hdc, TRANSPARENT);</p>
<p>ScreenColor = RGB(0, 0, 255);<br />
SelectBrush(hdc, CreateSolidBrush(ScreenColor));</p>
<p>xl=*start_xl;<br />
yo=*start_yo;</p>
<p>Ellipse(hdc, (xl), (yo), (xl+8), (yo+8));</p>
<p>EndPaint (hwnd, &amp;ps) ;<br />
UpdateWindow(hwnd);<br />
return 1;<br />
}</p>
<p>Vielen Dank schon im Vorraus, für eure Hilfe!</p>
<p>Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081830</guid><dc:creator><![CDATA[das_chris]]></dc:creator><pubDate>Wed, 21 Jun 2006 08:07:48 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 08:18:38 GMT]]></title><description><![CDATA[<p>Das hat nix mit Ansi-C zu tun. Sondern mit der WinAPI.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081836</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081836</guid><dc:creator><![CDATA[DarthZiu]]></dc:creator><pubDate>Wed, 21 Jun 2006 08:18:38 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 08:39:41 GMT]]></title><description><![CDATA[<p>und was ist winApi?</p>
<p>kann ich da irgendwo was dran drehen??</p>
<blockquote>
<p>Vielen Dank schon im v******, für eure Hilfe!</p>
</blockquote>
<p>sollte voraus (mit 2 r) heissen, keine ahnung warum der das gesternchent hat....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081859</guid><dc:creator><![CDATA[das_chris]]></dc:creator><pubDate>Wed, 21 Jun 2006 08:39:41 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 09:15:25 GMT]]></title><description><![CDATA[<p>kann mir jemand ne Lösung zu meinem Problemchen geben oder hab ich nicht nur ein Problemche, sondern ein handfestes Problem? Ich wäre euch sehr dankbar!!</p>
<p>Ich schwitze</p>
<p>Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081895</guid><dc:creator><![CDATA[das_chris]]></dc:creator><pubDate>Wed, 21 Jun 2006 09:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 09:26:47 GMT]]></title><description><![CDATA[<p>Wie gesagt, du bist hier im <strong>falschen</strong> Forum. Was du da schreibst ist WinAPI (Windows Application Programmers Interface). Das sind Funktionen, die dir Windows zur Verfügung stellt - z.B. um Fenster zu erstellen und darin zu zeichnen.</p>
<p>Es gibt hier auch ein Forum zur WinAPI - wenn du dort jemanden fragst (oder dich ein Mod verschiebt) bekommst du sicherlich schnell Hilfe.</p>
<p>Dein Programm <strong>ist</strong> ein WinAPI-Programm (ich schätze mal, du hast es nur irgendwo abgetippt - sonst wüsstest du das). Das hat nichts mit ANSI C oder C++ Standard zu tun.</p>
<p>Und voraus, wir mit einem 'r' geschrieben deswegen wird es &quot;gesternchend&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081906</guid><dc:creator><![CDATA[DarthZiu]]></dc:creator><pubDate>Wed, 21 Jun 2006 09:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 14:42:55 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=13512" rel="nofollow">c.rackwitz</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=10" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082161</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 21 Jun 2006 14:42:55 GMT</pubDate></item><item><title><![CDATA[Reply to Paint- Funktion on Wed, 21 Jun 2006 15:37:28 GMT]]></title><description><![CDATA[<p>edit: habe gerade zweiten thread gesehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082207</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Wed, 21 Jun 2006 15:37:28 GMT</pubDate></item></channel></rss>