Search code examples
delphigraphics32

Where is GR32_PNG in the latest release (2.0 final) of the Graphics32 Delphi library?


So, I just upgraded Graphics32 to the latest version and my code no longer compile.

I want to load a PNG with transparency from a resource into a TImage32.

Previously I did:

uses
    GR32, GR32_PortableNetworkGraphic, GR32_Image, GR32_PNG;

var
   Logo: TResourceStream;

Logo := TResourceStream.Create(MainInstance, 'MyLogo', RT_RCDATA);
try
    LoadBitmap32FromPNG(Image32Logo.Bitmap, Logo);
finally
    Logo.Free;
end;

But with the new release units GR32_PortableNetworkGraphic and GR32_PNG no longer exists.

I can't find in the library code any mention of png anymore...

I managed to do:

uses
    GR32, GR32_Image;

var
   Logo: TResourceStream;

Logo := TResourceStream.Create(MainInstance, 'MyLogo', RT_RCDATA);
try
    Image32Logo.Bitmap.LoadFromStream(Logo);
finally
    Logo.Free;
end;

But the transparency is lost. How can I achive PNG transparency with Graphics32 2.0 under Delphi 12?


Solution

  • The solution is to do not use the latest version tag (2.0 Final). If you clone master, the missing files are in there (version in files of master are 3.0 currently).