Przeglądaj źródła

* Fix to correctly write gray values from Johann (Bug ID 27924)

git-svn-id: trunk@30696 -
michael 10 lat temu
rodzic
commit
e86aa04433
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      packages/fcl-image/src/fpwritepng.pp

+ 2 - 2
packages/fcl-image/src/fpwritepng.pp

@@ -475,13 +475,13 @@ end;
 function TFPWriterPNG.ColorDataGrayAB(color:TFPColor) : TColorData;
 begin
   result := ColorDataGrayB (color);
-  result := (result shl 8) and hi(color.Alpha);
+  result := (color.Alpha and $ff00) or result;
 end;
 
 function TFPWriterPNG.ColorDataGrayAW(color:TFPColor) : TColorData;
 begin
   result := ColorDataGrayW (color);
-  result := (result shl 16) and color.Alpha;
+  result := (color.Alpha shl 16) or result;
 end;
 
 function TFPWriterPNG.ColorDataColorB(color:TFPColor) : TColorData;