Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi graph (grobes problem) ;) (https://www.delphipraxis.net/87110-graph-grobes-problem-%3B.html)

passsy 23. Feb 2007 12:40


graph (grobes problem) ;)
 
also leute ich wollte n graph zeichenen hab aber keinen blassen und über DP suche find ich au nix (google nichts was mir hilft)

eigentlich ganz einfach x-achse zeit y-achse werte (0-1000)

muss ich glaub mit nem TImage machen aber kann ich die punkte auch miteinander verbinden lassen?

oder geht das ganz anders? :gruebel:

sirius 23. Feb 2007 12:44

Re: graph
 
Variante 1: Es gibt die Komponente TChart
Variante 2: Du malst auf ein Canvas mit moveto und lineto. Auf welches (Tform, TImage, ...) ist egal. Das kommt darauf an, was du nachher damit machen möchtest.

SnuffMaster23 23. Feb 2007 12:49

Re: graph
 
Mit Image1.Picture.Bitmap.Canvas, mit den Methoden MoveTo und LineTo ;)

//red box :(

ice.icewing 23. Feb 2007 12:57

Re: graph
 
Mit einem Bespiel versteht man immer schneller:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var i,j : integer;
begin
  with Paintbox1.Canvas do begin
    Pen.Color := clBlack;
    Pen.Width := 1;
    Pen.Style := psSolid;
    MoveTo(10,10);
    LineTo(10, PaintBox1.Height-10);
    LineTo(PaintBox1.Width-10, PaintBox1.Height-10);
    Pen.Color := clRed;
    Pen.Width := 2;
    Pen.Style := psSolid;
    for i := 11 to PaintBox1.Width-12 do begin
      if (i mod 4) = 0 then begin
        j := round(sin(i/20)*40)+PaintBox1.Height-80;
        Ellipse(i, j, i+5, j+5); //Kreis
      end;
    end;
  end;
end;
Mit der Ellipse ist nur Schow da tuts auch Pixels.

icewing

sakura 23. Feb 2007 13:03

Re: graph
 
Erweitere doch bitte den Titel so, dass man weiß, was daws Problem mit dem Graphen grob ist.

...:cat:...

passsy 23. Feb 2007 13:24

Re: graph (grobes problem) ;)
 
hmm so jetzt mach ich es ma etwas präziser

also bsp.

1 TTimer
und ne random zahl (0-100)

ich will jetzt das er mir jede sec. die zahle auf dem graphen anzeigt.


das war eigentlich das was ich wissen wollt



trotzdem schon ma danke ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz