Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Canvas.Brush.Style bsCross Problem (https://www.delphipraxis.net/164298-canvas-brush-style-bscross-problem.html)

Blubbel 7. Nov 2011 10:47

Delphi-Version: 5

Canvas.Brush.Style bsCross Problem
 
Hallo Leute,
Ich möchte in den Hintergrund meines Koordinatensystems ein Raster haben. Es ist auch schon da nur ist der Hintergrund Schwarz und die Linien Weiß obwohl es umgekehrt, bzw. die Linien Hellgrau sein sollen. DAnke schon mal für eure Hilfe

Delphi-Quellcode:
 ACanvas.Brush.Style:= bsCross;
  ACanvas.Brush.Color:= clWhite;
  ACanvas.FillRect(ACanvas.ClipRect);

Bummi 7. Nov 2011 11:41

AW: Canvas.Brush.Style bsCross Problem
 
durchs Auge in die Brust ....

Delphi-Quellcode:
  Canvas.Brush.Style:= bsCross;
  Canvas.Brush.Color:= clSilver;
  SetBkColor(Canvas.Handle, ColorToRgb(clWhite));
  Canvas.FillRect(Canvas.ClipRect);

Blubbel 7. Nov 2011 11:48

AW: Canvas.Brush.Style bsCross Problem
 
Sehr geil, Danke!

Blubbel 7. Nov 2011 11:55

AW: Canvas.Brush.Style bsCross Problem
 
Aber jetzt zeichnet er das Raster komplett über die Form und nicht nur auf der Canvas bze. in der Paintbox

himitsu 7. Nov 2011 12:55

AW: Canvas.Brush.Style bsCross Problem
 
Canvas <> ACanvas

Blubbel 7. Nov 2011 13:00

AW: Canvas.Brush.Style bsCross Problem
 
Vorhin gings nicht aber jetzt... hmmm... ein bisschen verwirrt aber es funktioniert Danke euch

Blubbel 7. Nov 2011 13:09

AW: Canvas.Brush.Style bsCross Problem
 
könnt ihr mir nochmal sagen vielleicht wieso er hier statt blau schwarz zeichnet?? habs schon herumgeschoben und alles aber er nimmt nicht die farbe dir ich haben möchte.

Delphi-Quellcode:
for lIndex := 0 to high(AFuncData) do
  begin
    case round(AFuncData[lIndex][0]) of
      0:
      begin
        lStart:=round((GetWidth(ACanvas.ClipRect) div 2) * -1 / AScaleFactor);
        lEnd:=lStart * -1;

        ACanvas.MoveTo(lPoint.X, lPoint.Y);

        for x := lStart to lEnd do
        begin
          lPoint.X := x;
         
          lPoint.X := (lPoint.X * AScaleFactor) + (GetWidth(ACanvas.ClipRect)div 2);
          lPoint.Y := round((CalcX2(x)) * -1);
          lPoint.Y := (lPoint.Y * AScaleFactor) + (GetHeight(ACanvas.ClipRect)div 2);

          if x = lStart then
          begin
            ACanvas.MoveTo(lPoint.X, lPoint.Y);
          end;

          ACanvas.Pixels[lPoint.X, lPoint.Y]:=clblue;
          ACanvas.LineTo(lPoint.X, lPoint.Y);
          ACanvas.MoveTo(lPoint.X, lPoint.Y);
        end;
      end;

DeddyH 7. Nov 2011 13:15

AW: Canvas.Brush.Style bsCross Problem
 
Setz mal statt Pixels Canvas.Pen.Color auf clBlue.

Blubbel 7. Nov 2011 13:47

AW: Canvas.Brush.Style bsCross Problem
 
:wall:sowas blödes danke


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:13 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