![]() |
Re: Farbige bitmap schwarz weiß machen
Zitat:
Delphi-Quellcode:
Diese Procedure ist hier irgend wo in der DP zu finden.
procedure ConvertTo1BitBitmap(Bitmap: TBitmap);
const Blau = 1; Gruen = 2; Rot = 3; type PixArray = array[Blau..Rot] of Byte; var h, w, Wert, i: integer; p: ^PixArray; begin Bitmap.PixelFormat := pf24bit; //Temporär für scanline for h := 0 to Bitmap.Height - 1 do begin p := Bitmap.ScanLine[h]; for w := 0 to Bitmap.Width - 1 do begin Wert := (p^[Blau] + p^[Gruen] + p^[Rot]) div 3; if Wert <= 85 then for i := Blau to Rot do p^[i] := 0 else if Wert <= 170 then begin if (h mod 2) = (w mod 2) then for i := Blau to Rot do p^[i] := 0 else for i := Blau to Rot do p^[i] := 255; end else for i := Blau to Rot do p^[i] := 255; inc(p); end; end; Bitmap.Monochrome := True; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:32 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz