Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#10

Re: if-Abfrage vereinfachen

  Alt 10. Apr 2007, 15:02
Ok, hier mal die die vollständige Routine:
Delphi-Quellcode:
procedure TDWFotoBook.PaintGrid(Show: Boolean = True);

  procedure DrawDots;
  var
    i : Integer;
    j : Integer;
  begin
    with FImageEnVect do
    begin
      // draw dots
      for i := 0 to Width div FGridWidth do
      begin
        for j := 0 to Height div FGridWidth do
        begin
          Bitmap.Canvas.Pixels[i * FGridWidth, j * FGridWidth] := clBlack;
        end;
      end;
      Update;
    end;
  end;

begin
  Assert(Assigned(ImageEnVect), IENIL);
  // deselect all layers, otherwise we would draw on the selected layer
  FImageEnVect.LayersCurrent := 0;
  // set pen mode
  if (Show and not FShowGrid) or (Show and FShowGrid) then
  begin
    FImageEnVect.Bitmap.Canvas.Pen.Mode := pmBlack;
  end
  else if (FShowGrid and not Show) or (not FShowGrid and not Show) then
  begin
    FImageEnVect.Bitmap.Canvas.Pen.Mode := pmNotXor;
  end;

  DrawDots;

  Self.FShowGrid := Show;
end;
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat