<?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[langsames OnMouseMove]]></title><description><![CDATA[<p>Hallo,<br />
ich wollte eine Karte nach oben schieben, sobald die Mouse sich über der Karte befindet. Ich habe es wie folgt probiert, aber es läuft sehr langsam ab. Gibt es eine Alternative?</p>
<pre><code>void __fastcall TForm1::Image1MouseMove(TObject *Sender, TShiftState Shift,
      int X, int Y)
{
gib_spieler();
if ( X&gt;100 &amp;&amp; X&lt;140 &amp;&amp; Y&gt;(600-186) &amp;&amp; Y&lt;600)
  {
  cursor_pos=0; //int Wert für die Karte
  }
...
...//hier kommen dann die anderen Karten
...
}
</code></pre>
<p>dann zeichne ich die Karten aus einer ImageList:</p>
<pre><code>for (int r=0; r&lt;10; r++)
  {
  Graphics::TBitmap* picPtr=new Graphics::TBitmap;
  ImageList1-&gt;GetBitmap(spieler_1[r],picPtr);
  if (cursor_pos==r)
    {
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),350,picPtr);
    }
    else
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),400,picPtr);
    delete picPtr;
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/99387/langsames-onmousemove</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 04:26:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/99387.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Jan 2005 20:31:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 20:31:03 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich wollte eine Karte nach oben schieben, sobald die Mouse sich über der Karte befindet. Ich habe es wie folgt probiert, aber es läuft sehr langsam ab. Gibt es eine Alternative?</p>
<pre><code>void __fastcall TForm1::Image1MouseMove(TObject *Sender, TShiftState Shift,
      int X, int Y)
{
gib_spieler();
if ( X&gt;100 &amp;&amp; X&lt;140 &amp;&amp; Y&gt;(600-186) &amp;&amp; Y&lt;600)
  {
  cursor_pos=0; //int Wert für die Karte
  }
...
...//hier kommen dann die anderen Karten
...
}
</code></pre>
<p>dann zeichne ich die Karten aus einer ImageList:</p>
<pre><code>for (int r=0; r&lt;10; r++)
  {
  Graphics::TBitmap* picPtr=new Graphics::TBitmap;
  ImageList1-&gt;GetBitmap(spieler_1[r],picPtr);
  if (cursor_pos==r)
    {
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),350,picPtr);
    }
    else
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),400,picPtr);
    delete picPtr;
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/708215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708215</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Thu, 27 Jan 2005 20:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 20:38:40 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das Objekt picPtr wird wohl 10 mal pro MouseMove erstellt, beschrieben und gelöscht. Was erwartest du?<br />
Leg dir ein Buffer-Bitmap als Member des betreffenden Forms an, damit bekommst du das ständige new und delete weg (nur noch einmal bei Close- und Hide-Event).<br />
Wenn du noch besser machen willst, lege die einzelnen Bilder statt in eine ImageList gleich in 10 einzelne Bitmaps, am besten in ein (Dynamic)Array. Dann kannst du direkt zeichnen, ohne das Bitmap kopieren zu müßen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708226</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 27 Jan 2005 20:38:40 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 20:42:46 GMT]]></title><description><![CDATA[<p>Wie lege ich die Bilder in ein Array? Hast du vielleicht einen kleinen Ansatz?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708233</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Thu, 27 Jan 2005 20:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 21:22:06 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich würde es so machen :<br />
- Die Bitmaps, die in der Imageliste sind, bindest du es als Ressourcen ein. Dazu öffnest du das BCB-Tool Bildeditor und erstellst eine neue Ressourcendatei (*.res). Dann kannst du mit dem Kontextmenü über &quot;Inhalt&quot; neue Bitmaps erstellen, in die du deine vorhandenen kopierst. Diesen neuen Einträgen gibst du eindeutige Namen (Kontextmenü über Bitmap-Eintrag, Umbennenen), z.B. &quot;Spieler1&quot; bis &quot;Spieler10&quot;. Diese Ressourcendatei speicherst du in dem Projektverzeichnis, z.B. unter dem Namen &quot;Spieler.res&quot;<br />
- Im Projekt selber fügst du in dem betreffenden Formular (Bei meinem Beispiel Form1) in den Includes die Zeile</p>
<pre><code class="language-cpp">USERC(&quot;Spieler.res&quot;);
</code></pre>
<p>hinzu.<br />
- In der Datei Form1.hpp erweiterst du dir Deklaration von Form1 um das Array :</p>
<pre><code class="language-cpp">protected :
  DynamicArray&lt;TBitmap *&gt; SpielerBitmap;
</code></pre>
<p>- Du erstellst für Form1 die Events OnShow und OnHide. In diese schreibst du</p>
<pre><code class="language-cpp">void __fastcall TForm1::FormShow(TObject *Sender)
{
  for (int Lv = 0; Lv &lt; 10; Lv++) // 10 = Anzahl der Spieler 
  {
    SpielerBitmap.Length++; // Array erweitern
    SpielerBitmap[Lv] = new TBitmap(); // Objekt für neues Bild erstellen
    SpielerBitmap[Lv]-&gt;LoadFromResourceName(&quot;Spieler&quot; + IntToStr(Lv +1)); // Bitmap aus Resourcen laden 
    }
  }

void __fastcall TForm1::FormHide(TObject *Sender)
{
  // Alle Bitmap-Objekte aus Array löschen
  for (int Lv = 0; Lv &lt; SpielerBitmap.Length; Lv++)
    delete SpielerBitmap[Lv];
  SpielerBitmap.Length = 0; // Array zurücksetzen
  }
</code></pre>
<p>- Dann kannst du in deiner Funktion die Bitmaps ganz einfach ansprechen :</p>
<pre><code class="language-cpp">for (int r=0; r&lt;SpielerBitmap.Length; r++)
  {
  if (cursor_pos==r)
    {
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),350,SpielerBitmap[r]);
    }
    else
    Image1-&gt;Canvas-&gt;Draw(100+(r*40),400,SpielerBitmap[r]);

   }
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708264</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 27 Jan 2005 21:22:06 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 21:43:25 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Die Bitmaps, die in der Imageliste sind, bindest du es als Ressourcen ein.</p>
</blockquote>
<p>Und das hätte welchen Vorteil?<br />
TImageList ist doch schon ein supi dynamisches Array, und verfügt über eigene Methoden, das jeweils gewünschte Bild auszugeben.<br />
Die Imagelist kommt eigentlich nur dann nicht in Frage, wenn die Bilder unterschiedlich gross sind, was hier aber offenbar nicht der Fall ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708293</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 27 Jan 2005 21:43:25 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 21:53:04 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>okay, Jansen hat Recht, das mit den Ressourcen ist nicht nötig. Statt TImageList-&gt;GetBitmap nimmst du TImageList-&gt;Draw und zeichnest direkt in das Ziel-Image.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708305</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 27 Jan 2005 21:53:04 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 27 Jan 2005 21:53:34 GMT]]></title><description><![CDATA[<p>Danke für die Anregungen. Da habe ich einiges zu probieren. Es dauert bei mir ein bisschen bis ich alles getestet habe (Bin leider berufstätig und kein Schüler oder Student.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708306</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Thu, 27 Jan 2005 21:53:34 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sat, 29 Jan 2005 14:59:30 GMT]]></title><description><![CDATA[<p>Habe es fertig und wollte mal die Lösung angeben (vielleicht hilft es jemanden):</p>
<p>1. In die Headerdatei:</p>
<pre><code>private:
        Graphics::TBitmap *spieler_a[32];
</code></pre>
<p>2. Bilder aus der ImageList ins Array:</p>
<pre><code>void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int r=0; r&lt;32; r++)
  {
  spieler_a[r]=new Graphics::TBitmap;
  ImageList1-&gt;GetBitmap(r,spieler_a[r]);
  }
}
</code></pre>
<p>3. Verwenden des Array mit MouseMove ect.</p>
<pre><code>if ( X&gt;460 &amp;&amp; X&lt;500 &amp;&amp; Y&gt;(600-186) &amp;&amp; Y&lt;600)
  {
  Image1-&gt;Canvas-&gt;Draw(100+(9*40),350,spieler_a[9]);
  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/709644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709644</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Sat, 29 Jan 2005 14:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sat, 29 Jan 2005 15:09:25 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>jetzt hast du es nicht effizient gamacht (was wohl meine Schuld ist). Entweder du nimmst TImageList ODER ein eigenes Array.<br />
Wie bereits beschrieben, hat die ImageList die Funktion Draw, mit der du ohne Umwege ein Bitmap zeichnen kannst. Dann kannst du das eigene Array wieder weglassen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709657</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sat, 29 Jan 2005 15:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sat, 29 Jan 2005 15:39:00 GMT]]></title><description><![CDATA[<p>Ich habe auch eine ganze Weile nach einer Lösung mit ImageList1-&gt;Draw(...); gesucht. Gibt es denn etwas einfaches wie:</p>
<pre><code>ImageList1-&gt;Draw(1,x-koordinate,y-koordinate);
</code></pre>
<p>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709685</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709685</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Sat, 29 Jan 2005 15:39:00 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sat, 29 Jan 2005 15:57:28 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Aus der Hilfe zu den Methoden der TImageList</p>
<blockquote>
<p>Die Methode Draw zeichnet das mit dem Parameter Index angegebene Bild auf der bereitgestellten Zeichenfläche.</p>
<p>void __fastcall Draw(Graphics::TCanvas* Canvas, int X, int Y, int Index, bool Enabled);</p>
<p>Beschreibung</p>
<p>Verwenden Sie die Methode Draw zum Zeichnen eines Bildes auf der Zeichenfläche. Das Bild wird an der Position X, Y in dem Stil gezeichnet, der in der Eigenschaft DrawingStyle festgelegt ist. Wenn der Parameter Enabled auf false gesetzt ist, wird das Bild in Graustufen gezeichnet.</p>
</blockquote>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709693</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sat, 29 Jan 2005 15:57:28 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sun, 30 Jan 2005 12:33:07 GMT]]></title><description><![CDATA[<p>Ich bekomme es leider nicht hin. Habe jetzt das Problem, daß ich nicht verstehe wie ich ein einzelnes Bild meiner ImageList zugreifen kann. Mir fehlt etwas das Verständnis für diesen Ausdruck: &quot;Graphics::TCanvas* Canvas&quot;. Kann mir jemand ein Beispiel für ImageList1-&gt;Draw(...) geben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/710267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710267</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Sun, 30 Jan 2005 12:33:07 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sun, 30 Jan 2005 12:47:53 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ist doch ganz einfach :</p>
<pre><code class="language-cpp">for (int r=0; r&lt;SpielerBitmap.Length; r++)
  {
  if (cursor_pos==r)
    ImageList1-&gt;Draw(Image1-&gt;Canvas,100+(r*40),350,r, true);    
  else
     ImageList1-&gt;Draw(Image1-&gt;Canvas,100+(r*40),400,r, true);    
   }
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/710279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710279</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 30 Jan 2005 12:47:53 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Sun, 30 Jan 2005 15:25:33 GMT]]></title><description><![CDATA[<p>Oh Wunder, es klappt. Vielen Dank!!! <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/710385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710385</guid><dc:creator><![CDATA[friedrich k.]]></dc:creator><pubDate>Sun, 30 Jan 2005 15:25:33 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 08:45:47 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann ich ein bmp in ein 2d Array laden?</p>
<p>euer Pate</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141630</guid><dc:creator><![CDATA[Der Pate]]></dc:creator><pubDate>Thu, 21 Sep 2006 08:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 08:52:22 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Gegenfrage : Wozu brauchst du sowas?<br />
Nimm <em>TBitmap</em>, mit der Eigenschaft <em>TBitmap::Pixels</em> kannst du auch jeden Einzelnen Pixel lesen und schreiben.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141633</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 21 Sep 2006 08:52:22 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 08:58:26 GMT]]></title><description><![CDATA[<p>um die position auf ein bild zu ermitteln, es wir ein bild angezeigt wo ich die mauspos einlese im array schaue ich dann nach einer bestimmten farbe...</p>
<p>kannst du mir das bitte genauer schreiben</p>
<p>also zb so</p>
<p>TBitmap Array[100][100];</p>
<p>Array[][] = LoadFromFile(&quot;\\bild.bmp);</p>
<p>euer pate</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141641</guid><dc:creator><![CDATA[Der Pate]]></dc:creator><pubDate>Thu, 21 Sep 2006 08:58:26 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 09:03:16 GMT]]></title><description><![CDATA[<p>Schau bitte nochmal nach TBitmap::Pixels. Das ist ein 2D-Array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141646</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 21 Sep 2006 09:03:16 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 09:30:04 GMT]]></title><description><![CDATA[<p>sorry ich finde nix, in der hilfe gibt es keine eigenschaft pixel.<br />
es gibt nur eine pixelformat, damit kann man das format ändern</p>
<p>ich sollte vieleicht erwähnen das ich bcb benutze</p>
<p>euer pate</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141659</guid><dc:creator><![CDATA[Der Pate]]></dc:creator><pubDate>Thu, 21 Sep 2006 09:30:04 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 09:42:04 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Nun gut, das muß <em>TBitmap::Canvas::Pixels</em> heißen.<br />
Zugriff also zum Beispiel</p>
<pre><code class="language-cpp">TColor Farbe = Bitmap-&gt;Canvas-&gt;Pixels[10][5];
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141664</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 21 Sep 2006 09:42:04 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 10:44:20 GMT]]></title><description><![CDATA[<p>ähm<br />
ich sehe das so<br />
das bitmap eine variable von tcolor ist, oder?</p>
<p>braucht man eine lib um loadfromfile zu benutzen, irgendwie kennt er das nicht</p>
<p>euer pate</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141706</guid><dc:creator><![CDATA[Der Pate]]></dc:creator><pubDate>Thu, 21 Sep 2006 10:44:20 GMT</pubDate></item><item><title><![CDATA[Reply to langsames OnMouseMove on Thu, 21 Sep 2006 10:50:39 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>das bitmap eine variable von tcolor ist, oder?</p>
</blockquote>
<p>Nein, TBitmap ist eine eigene Klasse und hat mit TColor erstmal nichts zu tun.<br />
Sondern es hat interne Member, die dann einen []-Operator anbieten, um TColor zu lesen.</p>
<blockquote>
<p>braucht man eine lib um loadfromfile zu benutzen, irgendwie kennt er das nicht</p>
</blockquote>
<p>Wenn du das darauf beziehst</p>
<pre><code class="language-cpp">Array[][] = LoadFromFile(&quot;\\bild.bmp);
</code></pre>
<p>dann ist das ja auch ganz falsch. Das muß nun so aussehen.</p>
<pre><code class="language-cpp">Bitmap-&gt;LoadFromFile(&quot;\\bild.bmp);
</code></pre>
<p>Das hättest du aber auch aus der BCB-Hilfe zu <em>TBitmap::LoadFromFile</em> herauslesen können</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1141710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1141710</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 21 Sep 2006 10:50:39 GMT</pubDate></item></channel></rss>