B4J Library jWebP WebP Images

Cross platform version of this library: https://www.b4x.com/android/forum/threads/b4x-webp-images.119990/

This library is based on: https://github.com/zakgof/webp4j (Apache 2.0 license)
It allows loading WebP images.
It is a Windows only library.

Usage example:
B4X:
#CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\Objects\b4xlibs\Files temp\build\bin\ webp.dll
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private ImageView1 As ImageView
    Private wp As WebP
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("1") 'Load the layout file.
    MainForm.Show
    wp.Initialize
    ImageView1.SetImage(wp.Decode(File.ReadBytes(File.DirAssets, "1.webp")))
End Sub

The CustomBuildAction is required for the new integrated packager.

Download link: www.b4x.com/b4j/files/jWebP.zip
 
Last edited:

Magma

Expert
Licensed User
Longtime User
ImageView1.SetImage(wp.Decode(File.ReadBytes(File.DirAssets, "1.webp")))

Why in new B4J WebP library (1.00) there is no decode... and encode... ??? :-(
is there a tip somewhere how to include it ? - can i have the old lib ?
 

Magma

Expert
Licensed User
Longtime User
B4xlib .. Never think about it... I will try it.. thanks...

Hey less colors switching.. was different I think..

And jpg to webp bytes.. was a new question... But searching the forum found wp.decode and thought that was existing as solution... Sorry ?

So if found something i will continue posting to:
 
Top