Browse Source

* committed an old patch from M Schreiber, mantis #11855 that fixes loading 8-bit gray alpha using PNG loading.

git-svn-id: trunk@14972 -
marco 15 years ago
parent
commit
bf52e58175
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/fcl-image/src/fpreadpng.pp

+ 4 - 4
packages/fcl-image/src/fpreadpng.pp

@@ -519,15 +519,15 @@ end;
 function TFPReaderPNG.ColorGrayAlpha8 (CD:TColorData) : TFPColor;
 function TFPReaderPNG.ColorGrayAlpha8 (CD:TColorData) : TFPColor;
 var c : word;
 var c : word;
 begin
 begin
-  c := CD and $FF00;
-  c := c + (c shr 8);
+  c := CD and $00FF;
+  c := c + (c shl 8);
   with result do
   with result do
     begin
     begin
     red := c;
     red := c;
     green := c;
     green := c;
     blue := c;
     blue := c;
-    c := CD and $FF;
-    alpha := c + (c shl 8);
+    c := CD and $FF00;
+    alpha := c + (c shr 8);
     end;
     end;
 end;
 end;