7

Delphi-WebP is a project providing Delphi bindings for Google's libWebP.dll, which loads WebP images, but the project provides no Delphi-specific image code.
How can I load a WebP image into a TImage or TBitmap?

Gabriel
  • 20,797
  • 27
  • 159
  • 293
Prog1020
  • 4,530
  • 8
  • 31
  • 65
  • Answer from Wrapper author: >>>>Hi, This api is outdated and have bugs, I should close this project. I have uptodate api but I stopped my open source activities. – Prog1020 May 15 '13 at 10:31
  • this is the file format: https://developers.google.com/speed/webp/docs/riff_container#simple_file_format_lossy – Gabriel Jan 22 '20 at 10:55
  • non-native support (via google DLL) https://github.com/Wykerd/delphi-webp – Gabriel Feb 16 '21 at 19:49

1 Answers1

4

You should develop and register TGraphic sub-class, that can load/save WebP format images, just like TPNGImage, TJPEGImage and TGIFImage classes work.

You can get examples of such classes in recent versions of VCL (JPEG and PNG), on Torry.net or with libraries like:

Just learn how that was implemented in there projects and do the same for your project of WebP support.

PS. You can also derive your class from TBitmap rather than TGraphic - that would be less effective but simplier to do. For example of this approach see http://galfar.vevb.net/wp/projects/jpeg2000-for-pascal/ However that would loose all the WebP-specific information and would be "quick and dirty" hack rather than proper VCL-targeted implementation.

Arioch 'The
  • 15,799
  • 35
  • 62
  • 2
    I can't accept. Sorry It's big work, creating TGraphic like class, and I can't load WEBP to TBitmap - which is required or recommended first maybe... – Prog1020 May 14 '13 at 21:06
  • 3
    @Ingo but that means your question is actually rather request "someone, write this for me and give me a link". I doubt you would get any other answers... – Arioch 'The May 14 '13 at 21:31