Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Image Resize and Save

  1. #1
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,837

    Default Image Resize and Save

    Does anybody have a routine (or know of a solution) that can take an image file, then resize it and save it? I need to build it into my 19.0 app


    Mike

  2. #2
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: Image Resize and Save

    activex imaging components. We use Leadtools in a few projects but they stopped their development on axctivex a while ago

    another option is to create a small custom dot net component which would be my weapon of choice
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  3. #3
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,837

    Default Re: Image Resize and Save

    Thanks Mike.

    I have no experience with dot net stuff... but suppose that I will have to jump into that some day. Thanks for the pointers.

    M

  4. #4

    Default Re: Image Resize and Save

    Mike,

    I used the following in a webapp in the past.

    Code:
          //Get gStartProgram Command Parameters Directory WindowVisible WaitUntilFinished to ReturnValue
          Move ("convert.exe") To sCommand 
          Move sProgramPath    To sPath
          Move ('-resize 100x100 "'+sFileName+'"'*'"'+sThumbsPath+sImageFileName+'"') To sParams
          Move False To bVisible
          Move False  To bWait
          Get gStartProgram sCommand sParams sPath bVisible bWait to iRetVal
    convert is part of the ImageMagick suite.
    gStartProgram is a command written by Bernhard Ponemayr and can be found in this forum or at vdf-guidance here: http://www.vdf-guidance.com/ContribP...ntribRecId=134

    see also: https://support.dataaccess.com/Forum...ng-image-sizes
    --
    Wil

  5. #5
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,837

    Default Re: Image Resize and Save

    Thanks Wil!

  6. #6
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Re: Image Resize and Save

    Mike, I've used the exact same process as Wil has with ImageMagick, it works well.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  7. #7
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,837

    Default Re: Image Resize and Save

    Thanks Bob.

    I also noticed that an existing DLL i use seems to also do that.

  8. #8
    Join Date
    Feb 2009
    Location
    Rotterdam, Holland
    Posts
    2,025

    Default Re: Image Resize and Save

    We bought the ChestySoft csXImage ActiveX Control and use that for working with images, including resizing them in the background.
    It's affordable, still supported and works well.
    https://www.chestysoft.com/ximage/default.asp

    Code:
       Function GetResizeLongSize String sImage Integer iMaxLength String sOptSaveAs Returns Integer
          Handle hoImageBox
          Integer iRetval iHeight iWidth iLongestSize
          Boolean bOk bSaveAs
          String sSaveAs
          
          If (num_arguments >= 3) Begin
             Move sOptSaveAs to sSaveAs
             Move True to bSaveAs
          End
          If ((sImage <> "") and vFilePathExists(sImage)) Begin
             Get GetCreateImagebox to hoImageBox
             If (hoImageBox <> 0) Begin
                Send DoLoadFromFile of hoImageBox sImage
                
                Get ComImageHeight of hoImageBox to iHeight
                Get ComImageWidth  of hoImageBox to iWidth
                
                Move (iHeight max iWidth) to iLongestSize
                If ((iLongestSize > iMaxLength) and (iMaxLength > 0)) Begin
                   Get ComResizeFit of hoImageBox iMaxLength iMaxLength to bOk
                   If (not(bOk)) Move 1 to iRetval
                End
                
                If (not(iRetval)) Begin
                   If (bSaveAs) Send ComSaveToFile of hoImageBox sSaveAs
                   Else         Send ComSaveToFile of hoImageBox sImage
                End
                
    //            Send DoDestroyImageBox hoImageBox
             End
             Else Move 1 to iRetval
          End
          Else Move 1 to iRetval
          
          Function_Return iRetval
       End_Function
    


    Regards,

    Pieter

  9. #9
    Join Date
    Feb 2009
    Location
    Castlegar, BC Canada
    Posts
    4,837

    Default Re: Image Resize and Save

    Thanks Peiter

  10. #10
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Image Resize and Save

    Mike,

    It can be done with the Graphics Library.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •