Einzelnen Beitrag anzeigen

Nicodius

Registriert seit: 25. Apr 2003
Ort: Graz
2.234 Beiträge
 
Delphi 2006 Architect
 
#9

Re: color integer wert von "grau"

  Alt 14. Nov 2004, 07:26
naja ... ich glaub ihr m,üsst mir trotzdem weiterhelfen

Delphi-Quellcode:
var
  Form1: TForm1;
  MyPoints : Array [1..150] of TPoint;
  Zahl : Integer = 1;
implementation

{$R *.dfm}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var i : Integer;
begin
  Canvas.Brush.Color := clblack;
  Canvas.FillRect(Rect(0,0,Form1.Width,Form1.Height));
  Canvas.Pixels[X,Y] := 1111111;
  if Zahl < high(MyPoints)-1 then
    MyPoints[Zahl] := Point(X,Y)
  else
  begin
    zahl := 1;
    MyPoints[Zahl] := Point(X,Y);
  end;
  for i := 1 to high(MyPoints)-1 do
  begin
    If (MyPoints[i].X <> 0) and (MyPoints[i].Y <> 0) then
      Canvas.Pixels[MyPoints[i].X, MyPoints[i].Y] := rgb(105+i,105+i,105+i) ;
     // form1.caption := 'rgb(55+' + IntToStr(i) + ',55+' + IntToStr(i) +',55+' + IntToStr(i) ;
  end;
  //Canvas.Pixels[Xold,Yold] := clgray;
  //MyPoint[
  inc(Zahl);
end;

procedure TForm1.FormCreate(Sender: TObject);
var i : Integer;
begin
  for i := 1 to high(MyPoints)-1 do
    MyPoints[i] := Point(0,0);
end;
wenn ihr es ausprobiert werdet ihr sehen das der code insofern schlecht ist ...

ich wollte das der pixel der neu gezzeichnet wird der hellste ist(weiß also) und der rest pixel für pixel grauer wird (von hell zu dunkel) so das es auschaut als zieht es sich so hinterhe rund fällt ab

geht aber irgendwie nicht ganz und die logik hab ich nicht
Nico Müller
  Mit Zitat antworten Zitat