begin
Col:=StringToColor('
$00' + Edit1.Text);
//hier liegt meiner vermutung nach der Fehler
Edit2.text:=Format('
%d',[GetBValue(Col)]);
Edit3.Text:=Format('
%d',[GetGValue(Col)]);
edit4.Text:=Format('
%d',[GetRValue(Col)]);
end;
procedure TForm1.Edit2Change(Sender: TObject);
var a,b,c:
string;
begin
a:=Edit2.Text;
b:=Edit3.Text;
c:=Edit4.Text;
Trackbar1.Position:=StrToInt(Edit2.Text);
Edit1.Text:=Format('
2x%.2x%.2x', [StrToInt(a),StrToInt(b),StrToInt(c)]);
//Umwandlung des RGB in Hexa
end;
procedure TForm1.Edit3Change(Sender: TObject);
var a,b,c:
string;
begin
a:=Edit2.Text;
b:=Edit3.Text;
c:=Edit4.Text;
Trackbar2.Position:=StrToInt(Edit3.Text);
Edit1.Text:=Format('
2x%.2x%.2x', [StrToInt(a),StrToInt(b),StrToInt(c)]);
end;
procedure TForm1.Edit4Change(Sender: TObject);
var a,b,c:
string;
begin
a:=Edit2.Text;
b:=Edit3.Text;
c:=Edit4.Text;
Trackbar3.Position:=StrToInt(Edit4.Text);
edit1.Text:=Format('
2x%.2x%.2x', [StrToInt(a),StrToInt(b),StrToInt(c)]);
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
With Image1.Canvas
do
begin
pen.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Style:=bssolid;
rectangle(0,0,Image1.Width,Image1.Height);
Edit2.Text:=IntToStr(Trackbar1.Position);
end;
end;
procedure TForm1.TrackBar2Change(Sender: TObject);
begin
With Image1.Canvas
do
begin
pen.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Style:=bssolid;
rectangle(0,0,Image1.Width,Image1.Height);
Edit3.Text:=IntToStr(Trackbar2.Position);
end
end;
procedure TForm1.TrackBar3Change(Sender: TObject);
begin
With Image1.Canvas
do
begin
pen.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Color:=
RGB(Trackbar1.Position,Trackbar2.Position,Trackbar3.Position);
brush.Style:=bssolid;
rectangle(0,0,Image1.Width,Image1.Height);
Edit4.Text:=IntToStr(Trackbar3.Position);
end
end;