瀏覽代碼

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

git-svn-id: trunk@30696 -
michael 10 年之前
父節點
當前提交
e86aa04433
共有 1 個文件被更改,包括 2 次插入2 次删除
  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;