Einzelnen Beitrag anzeigen

TomyN

Registriert seit: 8. Nov 2006
Ort: Bayreuth
149 Beiträge
 
Delphi 10.3 Rio
 
#3

AW: Graph mit Graphics32 Darstellungsproblem

  Alt 2. Jan 2019, 15:49
Hi,

erstmal vielen Dank für Deine Antwort.

PolyLine gibt's leider nicht in Graphics32 und Polygon ist hier nicht zielführend ..

Code:
Type TLineData = TArrayOfFloatPoint;
 
Procedure DoPolyLine(const pfad: GR32_Paths.TFlattenedPath;
                             const data: TLineData;
                             const add: boolean);
  var maxl: cardinal;
      i:   cardinal;
  begin
    if ( Assigned(pfad) and ( Length(data) > 1 ) ) then begin
      maxl:= High(data);
      if add then
        pfad.MoveTo(data[0])
      else
        pfad.LineTo(data[0]);
      for I := 1 to maxl do pfad.LineTo(data[i]);
    end;
  end;
Der Aufruf erfolgt wie folgt:

Code:
Procedure OutCan(const daten: TArrayOfFloatPoint; const can: TCanvas32;
                 const shadow: boolean; const shadowY: single;
                 const tw: integer); inline;
  var endl: integer;
  begin
    endl:= high(daten);
    if (length(daten) > 0) then begin
      //Die linie
      can.Brushes[0].Visible:= TRUE;
      can.Brushes[1].Visible:= false;
      can.Path.Clear;
      can.Path.BeginPath;
      if (endl > 0) then begin
        (can.Brushes[0] as TStrokeBrush).StrokeWidth:= tw;
        DoPolyLine(can.Path, daten, False);
      end else begin
        (can.Brushes[0] as TStrokeBrush).StrokeWidth:= tw * 0.5;
        can.Path.Arc(daten[0], 0, doublePi, 0.25 * tw);
      end;
      can.Path.EndPath;
      //Füllen
      if Shadow then begin
        can.Path.Clear;
        can.Brushes[0].Visible:= FALSE;
        can.Brushes[1].Visible:= TRUE;
        //Die Daten dazu
        can.Path.Clear;
        can.Path.BeginPath;
        can.Path.MoveTo(daten[0].x, shadowY);
        uPaintGr32.DoPolyLine(can.Path, daten, False);
        can.Path.LineTo(daten[endl].X, shadowY);
        can.Path.ClosePath;
        can.Path.EndPath;
      end; // else can.Brushes[1].Visible:= TRUE;
    end;
  end;
Thomas Neumann
Meine Projekte
www.satlive.audio
www.levelcheck.de
  Mit Zitat antworten Zitat