Skip to Content
0

Changing the image resolution in powerbuilder

Jul 10, 2017 at 07:08 PM

83

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
0

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))
Else
   MessageBox("ConnectToNewObject", "Failed: " + String(li_rc), StopSign!)
End If

oMagick.DisconnectObject()
Destroy oMagick
Share
10 |10000 characters needed characters left characters exceeded