Author Topic: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.  (Read 6775 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2399
  • Gender: Male
    • www.zapsolution.com
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.

...
« Last Edit: October 07, 2009, 03:47:03 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2399
  • Gender: Male
    • www.zapsolution.com
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #1 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.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 3126
  • Gender: Male
    • José Roca Software
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #2 on: October 07, 2009, 08:14:28 PM »
 
I suggest to change the name of the TrueOrFalse parameter to something more explanatory, such bOverwrite.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2399
  • Gender: Male
    • www.zapsolution.com
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #3 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.

...

« Last Edit: October 08, 2009, 08:48:04 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 3126
  • Gender: Male
    • José Roca Software
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #4 on: January 19, 2010, 05:41:51 PM »
 
I have read that it doesn't work with Windows 7. Is that true?

Offline Pierre Bellisle

  • Jr. Member
  • **
  • Posts: 72
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #5 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 ?
« Last Edit: November 03, 2011, 05:50:37 PM by Pierre Bellisle »

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2399
  • Gender: Male
    • www.zapsolution.com
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #6 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.

...
« Last Edit: November 03, 2011, 07:06:18 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Pierre Bellisle

  • Jr. Member
  • **
  • Posts: 72
Re: Undocumented API to convert image file format between GIF/BMP/JPG/PNG.
« Reply #7 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.