Question Resetting Pic Size In Excel

vdennis

Member
Good day all. I have a program that creates an excel sheet and added pictures based on the product. (Product image.) My problem is that the images do vary in size and I need to be able to do a 'reset' on the images, like using the reset in Excel's tools. Or, if I could determine the dimensions of the pic, I could also do that method but have not seen any reference to getting that info.
So if I could use the former method, it would be executed after the pic was 'added' to the worksheet.
The latter method could be done by changing the 'pic size, on the load. That code follows:

hWorkSheet:shapes:addPicture(cImageSearch,0,1,88,iHozPos,48,48).

Trying to 'debug' the code from a macro has proved pointless at this stage.

Any help would be greatly appreciated.

-Dennis-
 

Cecil

19+ years progress programming and still learning.
Hi

I'm not sure if this is going to help but check out some code I did a few years ago to return then image dimensions for JPEG, GIF, BMP and PNG. Feel free to use with care and no responsibility (i.e. don't blame me if it screws up), make any improvements and share.:)

Getting Image Dimensions
 

joey.jeremiah

ProgressTalk Moderator
Staff member
there's also a progress a .gif, .jpg, .png implementation that works on unix/linux and windows in the progress standard libraries project @oehive.org

<code>
<slib/slibimg.i}

run img_getImageSize(
input "<filename>",
output iWidth,
output iHeight,
output dHorizDpi,
output dVertDpi ).
</code>

disclosure: i wrote the project
 

vdennis

Member
Cecil,
Just tried it out and it works perfectly for the job in mind. We run both GUI and CHAR programs, so I am hoping that it will also work in the CHAR side, but for the life of me I don't know why unless we just needed to get some for of listing. (We run InFor SX here, but have done tons of custom work.) Wish I could return the favor somehow. Only thing I have is a program that allow you to write code in Progress and then create reports in Crystal Reports ( the old RDC stuff.) Created the install in 2005 and still works just fine today. We use CR for custom quotes or Order Guides, that include pictures of the product. Let me know if you have any need for it, or anyone else for that matter.
-Dennis-
 
Top