Skip to Content
avatar image
Former Member

Changing the image resolution in powerbuilder

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

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
    Add comment
    10|10000 characters needed characters exceeded