SetColor is a protected method of TFPImageCanvas, which as Blaazen suspected simply uses the slow Pixels[] property.
In order to get working code you have to adapt the example you found as follows.
(The example is old and refers to earlier FPC/Lazarus versions which have since changed. The code nmtv posted differs from what is currently shown on the referenced wiki page).
{$mode objfpc}
program demo;
uses FPImage, FPWritePNG, FPImgCanv;
type
{ TFPImgCanvasEx }
TFPImgCanvasEx = class(TFPImageCanvas)
public
procedure SetColor(x, y: integer; const AValue: TFPColor); override;
end;
var canvas : TFPImgCanvasEx;
image : TFPCustomImage;
writer : TFPCustomImageWriter;
red, white : TFPColor;
x, y : integer;
{ TFPImgCanvasEx }
procedure TFPImgCanvasEx.SetColor(x, y: integer; const AValue: TFPColor);
begin
inherited SetColor(x, y, AValue);
end;
begin
{ Create an image 100x100 pixels}
Red.red:=65535;
Red.green:=0;
Red.blue:=0;
Red.alpha:=65535;
white.red := 65535;
white.blue := 65535;
white.alpha :=65535;
white.green := 65535;
image := TFPMemoryImage.Create (100,100);
{ Attach the image to the canvas }
Canvas := TFPImgCanvasEx.create(image);
{ Create the writer }
Writer := TFPWriterPNG.Create;
for y := 0 to 100 do begin
for x := 0 to 100 do begin
If x DIV 2 = 0 then
Canvas.SetColor(x, y, red) //there was an error here previously
else
Canvas.SetColor(x, y, white);
end;
end;
{ Save to file }
image.SaveToFile ('DrawTest.png');
{ Clean up! }
Canvas.Free;
image.Free;
writer.Free;
end.