cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Imaging Functions

SOLVED
Highlighted
Participant

Imaging Functions

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Imaging Functions

  • 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 2

Re: Imaging Functions

  • 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,

  

Re: Imaging Functions

Thanks Rajesh!

That works.