Autor Beitrag
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 07.08.05 14:50 
Hy, ich weiß das das schon min. 2 mal in dem Forum zur Sprache kam, ich habs aber echt nich gefunden...
Wie kann ich in einem Image die pixelfarben in eine andere umändern z.b. aus grün, rot machen oder so
Danke
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 07.08.05 15:07 
Sodele. Die procedure hab ich jetzt grad schnell in fünf Minuten zusammengebastelt. Musst noch guckn, ob's funktioniert. Hab grad kein Delphi da. ;)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure ReplaceColor(Image: TBitmap; SearchColor: TColor; ReplaceColor: TColor);
var
x, y: Integer;
begin
for y := 0 to Image.Height do
  for x := 0 to Image.Width do
    if Image.Canvas.Pixels[x, y] = SearchColor then
      Image.Canvas.Pixels[x, y] := ReplaceColor;
end;


Aufruf z.B. so: (ersetzt weiß durch schwarz in Image1)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
ReplaceColor(Image1.Picture.Bitmap, clWhite, clBlack);
end;
Ironwulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 07.08.05 15:18 
Danke funktioniert perfekt
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 07.08.05 15:28 
user profile iconIronwulf hat folgendes geschrieben:
Danke funktioniert perfekt

Kein Problem. ;) Viel Spaß damit... :tongue: