1. Brage Mogstad
  2. PowerBuilder
  3. Friday, 2 June 2023 12:23 PM UTC

Hello,
I'm a bit stuck, google didn't deliver as good as it usually do this time around.
I'm looking for a VERY easy and quick way to resize images from ex. 4k 8MB files to around 2-300 Kb files (let's say 72 dpi 1080p).
Imagine doing this for common formats as ex .bmp & .jpg in PowerBuilder 2019 R3 (PBLs with sample code would be great)
It has to be done locally and I recon' with OLE and/or DLL integration and saved to a file I can convert to a blob and store in a sybase db (no access to the internet).
If anyone know of a solution/product to recommend it would be greatly appreciated.

B

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 12 June 2023 16:02 PM UTC
  2. PowerBuilder
  3. # Permalink
I have a Run And Wait object that would help with command line. The built-in Run command doesn't wait for the external program to finish. My object also returns the external program's return code. https://www.topwizprogramming.com/freecode_runandwait.html
Comment
There are no comments made yet.
Tobias Roth Accepted Answer Pending Moderation
  1. Wednesday, 14 June 2023 04:21 AM UTC
  2. PowerBuilder
  3. # 1

Hi Brage,

last week we tested PB Ultimate Suite and it has an image editor userobject with a lot of functions.
https://www.pbultimatesuite.com/EN/modernize-pb-interface/image-editor.html

Image Editor Control by Ultimate Suite

I asked the developer Brad Wery if an enhancement would be possible to change the image quality.
The next step for him would be to create a non-visual object version of the functions and then seeing about adding quality settings and any other settings that are available. I don't know yet what the result of the feasibility and the planning will be.

If you have any questions, you can contact him: brad.wery@werysoft.com 

 

Regards Tobi

 

Comment
There are no comments made yet.
Brage Mogstad Accepted Answer Pending Moderation
  1. Saturday, 3 June 2023 00:41 AM UTC
  2. PowerBuilder
  3. # 2

Yes, found this article. Unfortunately, the com object did not properly register in windows as a usable OLE object for Powerbuilder OLE control both visual & non visual. Tried both x64 and x86 install, no luck. Thus I'm left with the less favourable run command (.exe w/command line option), I was hoping to avoid that. I'm currently looking into the IncPicture control, but there seems to be very few options for saving to certain format & a strange cropping issue when saving.

In other words, I'm starting to think about playing with the new pb webbrowser control and the canvas functionality. For me, a ole or dll sollution would be preffered over canvas, if it was easy to implement and well documented with examples.

B    

Comment
  1. Miguel Leeuwe
  2. Saturday, 3 June 2023 00:49 AM UTC
You could also try to do things with a C# DLL and then import the functions using the DLL importer tool.
  1. Helpful 1
  1. Brage Mogstad
  2. Saturday, 3 June 2023 01:09 AM UTC
Thanks, I'd actually might try that if the command-line option fails.
  1. Helpful
  1. John Fauss
  2. Saturday, 3 June 2023 02:28 AM UTC
If you do a search in this forum (use the search field above) for ImageMagick, you'll see several past posts. It appears that many developers have used the command line/batch file method of invoking this utility successfully. Good luck!
  1. Helpful 1
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 20:41 PM UTC
  2. PowerBuilder
  3. # 3
Comment
There are no comments made yet.
Brage Mogstad Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 18:12 PM UTC
  2. PowerBuilder
  3. # 4

Had a look at this,

Lots of PB & OLE examples, but I had no luck finding the option for installing this with the ImageMagick OleControl.

It didnt register and I have no clues as to what dll's should be used.

I couldt find any examples for external .dll function declarations w/dll's for PB. 

B

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 15:17 PM UTC
  2. PowerBuilder
  3. # 5

Haven't used it myself either, but here are some links worth to look at:

https://community.appeon.com/index.php/qna/q-a/aspect-ratio-for-pictures-in-datawindow-band?limitstart=0#reply-38185

https://sourceforge.net/projects/stdfndclass/files/Presentations/Imaging/

The first one should have some link to a presentation done by Chris.

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 2 June 2023 16:06 PM UTC
That Chris knows his imaging stuff .. LOL!

Yep ...the ImageMagicK and GraphicsMagick open source imaging tools can be your friend! ;-)
  1. Helpful 1
  1. Miguel Leeuwe
  2. Friday, 2 June 2023 16:08 PM UTC
Great stuff Chris!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 2 June 2023 13:39 PM UTC
  2. PowerBuilder
  3. # 6

Hi, Brage -

You might wish to take a look at: https://imagemagick.org/

I've not used it, but I know that Chris Pollach speaks highly of it and has recommended it in the past. Worth a look!

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.