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
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
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
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
Mike,
I used the following in a webapp in the past.
convert is part of the ImageMagick suite.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
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
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
Thanks Bob.
I also noticed that an existing DLL i use seems to also do that.
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
Mike,
It can be done with the Graphics Library.
Regards,
Data Access Worldwide
Vincent Oorsprong