Einzelnen Beitrag anzeigen

bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.123 Beiträge
 
Delphi 11 Alexandria
 
#1

Pixel in schwarz oder weiß unter FMX

  Alt 24. Okt 2018, 06:24
ich möchte schwarze und weiße Pixel in eine BMP unter Firemonkey zeichnen,
leider enzsteht bei mit nur ein grau /weißes Bild warum ?

(unter VCL war das Bild mit der analogen Variante / scanline dann schwarz und weiß)





Delphi-Quellcode:
var
    x, y : Integer;
    bitdata : TBitmapData;
    Color : TAlphaColor;

    begin

    if ( aBMP.Map( TMapAccess.maReadWrite, bitdata ) )
    then
      try

        for y := 0 to aBMP.Height - 1 do
          begin
            for x := 0 to aBMP.Width - 1 do
              begin

                if ( not GetPixelfromArray( x, y ) )
                then
                  begin
                    TAlphaColorRec( Color ).R := 255;
                    TAlphaColorRec( Color ).G := 255;
                    TAlphaColorRec( Color ).B := 255;


                  end
                else
                  begin
                    TAlphaColorRec( Color ).R := 0;
                    TAlphaColorRec( Color ).G := 0;
                    TAlphaColorRec( Color ).B := 0;
                  end;

                 bitdata.SetPixel( x, y, Color );

              end;

          end;
  Mit Zitat antworten Zitat