there are 2 main problems with your code
1) you use LoadFromLazarusResource instead of LoadFromResourceName
2) LoadFromResourcename has no way to define the type of resource you want to load
It gets the type from the virtual method GetResourceType which is not overridden in the TPortableNetworkGraphic and uses the default result from the TCustomBitmap class which is defined as RT_BITMAP.
In this case I would simple avoid using the build in methods and do it manually. eg
implementation
uses LCLType;
{$R *.lfm}
{$R images.res}
{ TForm1 }
procedure TForm1.FormCreate(Sender : TObject);
var
png : TPortableNetworkGraphic;
vStream : TResourceStream;
begin
png:=TPortableNetworkGraphic.Create;
try
vStream := TResourceStream.Create(HINSTANCE,'LOGO',RT_RCDATA);
try
Png.LoadFromStream(vStream);
Image1.Picture.Assign(png);
finally
vStream.Free;
end;
finally
Png.Free;
end;
end;
Try to use the above code in your sample project and see for your self. By the way I replaced the draw call with the assign because the png lost its transparency and it was replaced with a black background, this way the transparency is preserved.