Skip to Content

Changing the image resolution in powerbuilder

Jul 10, 2017 at 07:08 PM


avatar image
Former Member

Hi Everyone,

I am trying to change the image resolution (lower) i am using image magic for conversion. but i am unable to convert the file to lower resolution. please help with any code snippets.

Thank you.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Jul 10, 2017 at 07:39 PM

I would try using their OLE interface. Here is an example that converts a JPG to PNG.

OLEObject oMagick
String ls_origfile, ls_destfile
Integer li_rc
Any la_result

ls_origfile = "C:\PBSource\PB105\ImageMagick\Totoro.jpg"
ls_destfile = "C:\PBSource\PB105\ImageMagick\Totoro.png"

oMagick = Create OLEObject

li_rc = oMagick.ConnectToNewObject("ImageMagickObject.MagickImage")
If li_rc = 0 Then
   la_result = oMagick.Convert(ls_origfile, "-format", "png", ls_destfile)
   MessageBox("Convert", "Result: " + String(la_result))
   MessageBox("ConnectToNewObject", "Failed: " + String(li_rc), StopSign!)
End If

Destroy oMagick
10 |10000 characters needed characters left characters exceeded