That didn't seem to work, but changing it a little did:
var
png : TPortableNetworkGraphic;
bmp : TBitmap;
begin
png := TPortableNetworkGraphic.Create;
png.PixelFormat := pf32bit;
bmp := TBitmap.Create;
bmp.PixelFormat := pf32bit;
bmp.Transparent := True;
bmp.TransparentColor := RGBToColor(255,0,255);
bmp.LoadFromFile('d:\netti\temp.bmp');
png.SetSize(bmp.Width, bmp.Height);
png.Canvas.Draw(0, 0, bmp);
png.SaveToFile('d:\netti\temp.png');
bmp.Free;
png.Free;
I got rid of assign(), and made the bmp transparent instead.