edit: ups, da warste schneller, ich bearbeite mal:
Delphi-Quellcode:
procedure dunkler(Bitmap: TBitmap32;
const dp: Byte = 10);
var
PixelLine: pColor32array;
//hier gibts problmeme, weiss nicht welchen typ ich hier angeben muss
x, y: integer;
begin
for y := 0
to Bitmap.height - 1
do
begin
PixelLine := Bitmap.ScanLine[y];
for x := 0
to (Bitmap.width) - 1
do
PixelLine[x].Red := lighten(PixelLine[x].red,
dp * (-1));
//Lighten(C: TColor32; Amount: Integer): TColor32;
PixelLine[x].Green := lighten(PixelLine[x].green,
dp * (-1));
//Lighten(C: TColor32; Amount: Integer): TColor32;
PixelLine[x].Blue := lighten(PixelLine[x].blue,
dp * (-1));
//Lighten(C: TColor32; Amount: Integer): TColor32;
end;
end;
also so? amount sollte beim verdunkeln wohl negativ sein, also *(-1)
Zitat:
Lighten
function Lighten(C: TColor32; Amount: Integer): TColor32;
Description
The resulting color is formed from the color components of the parameter C by adding Amount to each of them and clipping the sum to [0…255] range.
Amount may be negative.
See Also