Skip to main content
1-Visitor
June 4, 2019
Solved

Imaging Functions

  • June 4, 2019
  • 2 replies
  • 1265 views

Hi All,

I currently try to use "ImagingFunctions" from Imaging Tools Extension, but i have some problems

1) I can't input image parameter. I try these two ways but none of them work

image: "/Thingworx/MediaEntities/DogJPG" /* IMAGE */
image: "C:\Users\Desktop\Thingworx8\ManU.jpg" /* IMAGE */

 

2) What is the meaning of these parameters?

image.png

Thanks!

Best answer by Rajesh_Sayana
  • Please add an input parameter of base type image to the service where you are trying to use the "ImagingFunctions".
  • As you add the input parameter, choose the check box that says "Has Default Value"
  • It would then provide an option to upload the image.
  • Assign the input parameter name to the image variable in the params object.
  • You can get rid of cropX, cropY, cropWidth, cropHeight properties from the params object. They are used to crop the  image.
    var params = {
    	image: inputimage /* IMAGE */,
    	width: 760 /* NUMBER */,
    	height: 400 /* NUMBER */
    };
    // result: IMAGE
    var result = Resources["ImagingFunctions"].ConvertImage(params);

 

Best regards,

Rajesh,

  

2 replies

5-Regular Member
June 4, 2019
  • Please add an input parameter of base type image to the service where you are trying to use the "ImagingFunctions".
  • As you add the input parameter, choose the check box that says "Has Default Value"
  • It would then provide an option to upload the image.
  • Assign the input parameter name to the image variable in the params object.
  • You can get rid of cropX, cropY, cropWidth, cropHeight properties from the params object. They are used to crop the  image.
    var params = {
    	image: inputimage /* IMAGE */,
    	width: 760 /* NUMBER */,
    	height: 400 /* NUMBER */
    };
    // result: IMAGE
    var result = Resources["ImagingFunctions"].ConvertImage(params);

 

Best regards,

Rajesh,

  

Quannd1-VisitorAuthor
1-Visitor
June 18, 2019

Thanks Rajesh!

That works.