Also hab dir mal was geschrieben was dir vielleicht helfen könnte.
Delphi-Quellcode:
procedure MakeGray(ABmp: TBitmap);
procedure SetGray(var x: PRGBQuad);
var mitte: Byte;
begin
mitte := (x^.rgbBlue + x^.rgbGreen + x^.rgbRed) div 3;
x^.rgbBlue := mitte;
x^.rgbGreen := mitte;
x^.rgbRed := mitte;
end;
var i,j: Integer;
x: PRGBQuad;
begin
ABmp.PixelFormat := pf32Bit;
for i:= 0 to ABmp.Height-1 do
begin
x := ABmp.ScanLine[i];
for j:= 0 to ABmp.Width-1 do
begin
SetGray(x);
inc(x);
end;
end;
ABmp.PixelFormat := pf24Bit;
ABmp.Modified := true;
end;
// Verwendung
MakeGray(Image1.Picture.Bitmap);
Wobei sollte/muss man eigentlich p Disposen? Dann müsste man das noch einbauen aber ansonsten gehts.
Natürlich nicht. Man will ja nicht die Bitmapdaten freigeben
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."