On Wed, 8 Jul 2015, aradeonas wrote:

Here you are.

http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg

Your program contained an error, I should have seen it at once.
You used TFPCustomImage. This is an abstract class. You should have used a descendent like TFPMemoryImage instead.
(
the compiler warns you:
testpalette.lpr(10,37) Warning: Constructing a class "TFPCustomImage" with abstract 
method "SetInternalPixel"
)

So:

program testpalette;

uses fpimage,fpreadjpeg;

var
  i: Integer;
  Img: TFPCustomImage;

begin
  Img := TFPMemoryImage.Create(0, 0);
  try
    img.LoadFromFile('photo1.jpg');
    img.UsePalette := True;
    for i := 0 to img.Palette.Count-1 do
      With img.Palette.Color[i] do
        Writeln(red,',',green,',',blue);
  finally
    Img.free;
  end;
end.

Works as expected.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to