Powerbuilder Bildbearbeitung – In Powerbuilder Classic 12.6 gibt es die Möglichkeit über eine externe Library dem User eine Bildbearbeitungssoftware zur Verfügung zu stellen. Dafür ist keine OLE/COM Objekt Einbindung notwendig, sondern dies kann über native External Library Funktionen umgesetzt werden. Am Markt gibt es dafür eine DLL mit der Bezeichnung FreeImage.dll.  Diese DLL kann hier geladen werden -> http://freeimage.sourceforge.net/download.html

FreeImage.dll bittet unter anderem folgende Features:

  • Loading and saving of as many bitmap types as possible
  • Easy access to bitmap components, such as palettes and data bits
  • Converting bitmap’s bit depths from one to another
  • Accessing pages in a bitmap when there are multiple, such as in TIFF
  • Basic manipulation of bitmaps, such as rotation, flipping and resampling or point operations such as brightness and contrast adjustment
  • Alpha compositing and alpha blending

Powerbuilder Bildbearbeitung

Damit der volle Umfang genutzt werden kann, sind die Funktion in der DLL in Powerbuilder als Lokal External Funktionen zu deklarieren – auszugsweise sieht dies wie folgt aus:

Function long FreeImage_SaveU(long fif, long dib, string filename, int flags) library "FreeImage.dll" alias for "_FreeImage_SaveU@16"
Function long FreeImage_LoadU(long fif, string filename, long flags) Library "FreeImage.dll" Alias for "_FreeImage_LoadU@12" 
Subroutine FreeImage_Unload(long dib) Library "FreeImage.dll" Alias for "_FreeImage_Unload@4" 
Subroutine FreeImage_Initialise(long load_local_plugins_only) Library "FreeImage.dll" Alias for "_FreeImage_Initialise@4" 
Function long FreeImage_ConvertTo24Bits(long dib) Library "FreeImage.dll" Alias for "_FreeImage_ConvertTo24Bits@4"
function long FreeImage_Copy(long dib, int left, int top, int right, int bottom) library "FreeImage.dll" alias for "_FreeImage_Copy@20"

Anschließend können in Power Script diese Funktionen ganz normal verwendet werden.

Wer tiefer in diese Materie eintauchen möchte, kann diese hier tun.

Dipl.-Ing. Markus Haidinger MBA
Letzte Artikel von Dipl.-Ing. Markus Haidinger MBA (Alle anzeigen)

1 Kommentar.