Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => Useful TIPS => Topic started by: Patrice Terrier on October 07, 2009, 02:51:49 PM

Title: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Patrice Terrier on October 07, 2009, 02:51:49 PM
Convert image file format between GIF/BMP/JPG/PNG.

Wrapper for the undocumented SHConvertGraphicsFile function found in shlwapi.dll version >= 6.00

Source code is in the attached ZIP file.

...
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Patrice Terrier on October 07, 2009, 07:27:27 PM
For your information, i have written gConvert to create full 32-bit ARGB bitmap (from transparent PNG file), that will be used with the next WinLIFT WSA API skAlphablend.

...
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: José Roca on October 07, 2009, 08:14:28 PM
 
I suggest to change the name of the TrueOrFalse parameter to something more explanatory, such bOverwrite.
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Patrice Terrier on October 07, 2009, 09:10:52 PM
Yes, the last parameter is a boolean flag, %TRUE means OverWrite destination.

Indeed I am always using it in OverWrite mode myself.

...

Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: José Roca on January 19, 2010, 05:41:51 PM
 
I have read that it doesn't work with Windows 7. Is that true?
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Pierre Bellisle on November 03, 2011, 05:48:38 PM
I did some test,

with GetProcAddress
- Vista   32: Conversion OK
- Seven 32: No adress returned
- Seven 64: No address returned

With GetProcAddressDirectly by Semen
- Vista  32: Conversion OK
- Seven32: GPF
- Seven64: GPF

Maybe some update to Seven made it unusable.

Patrice, is it still working on your Seven ?
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Patrice Terrier on November 03, 2011, 06:58:31 PM
I just checked with the current version of Seven, and you and José are correct, it doesn't work anymore with it :-[

That's the problem with undocumented API, it could be changed at any time without prior notification.

...
Title: Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
Post by: Pierre Bellisle on November 03, 2011, 11:40:37 PM
Well, we still have GDI+.

Speaking of...
I just downloaded José's help file.

One word José...

Thank you, thank you, thank you.