ImagePlugin Module (Cross platform multi format de-/encoder)

Share your advanced PureBasic knowledge/code with the community.
PeDe
Enthusiast
Enthusiast
Posts: 278
Joined: Sun Nov 26, 2017 3:13 pm

Re: ImagePlugin Module (Cross platform multi format de-/enco

Post by PeDe »

Is it possible to use the ImagePlugin with the function "EncodeImage(#Image, #PB_ImagePlugin_PNG, #False, 32)"?
For this I have to use "UsePNGImageEncoder()" additionally. If I use #SystemImagePlugin_PNG as parameter, I don't get an image encoded.

Peter
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: ImagePlugin Module (Cross platform multi format de-/enco

Post by wilbert »

PeDe wrote:If I use #SystemImagePlugin_PNG as parameter, I don't get an image encoded.
It works fine when I try on my computer

Code: Select all

ImagePlugin::UseSystemImageEncoder()

SaveImage(Image, "test2.png", ImagePlugin::#SystemImagePlugin, ImagePlugin::#SystemImagePlugin_PNG)

*Buffer = EncodeImage(Image, ImagePlugin::#SystemImagePlugin, ImagePlugin::#SystemImagePlugin_PNG)
Windows (x64)
Raspberry Pi OS (Arm64)
PeDe
Enthusiast
Enthusiast
Posts: 278
Joined: Sun Nov 26, 2017 3:13 pm

Re: ImagePlugin Module (Cross platform multi format de-/enco

Post by PeDe »

Thank you wilbert,
I used the parameters incorrectly and did not set 'Flags' correctly. Now everything works without problems.

Peter
zikitrake
Addict
Addict
Posts: 868
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: ImagePlugin Module (Cross platform multi format de-/encoder)

Post by zikitrake »

@Wilbert, I don't know if you saw it. Or for other users that might be interested in a PB C Backend compatible version

https://www.purebasic.fr/english/viewto ... 16#p580716

:!: And thank you for your excellent work!!
PB 6.21 beta, PureVision User
Post Reply