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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Imaging Functions

Quannd
8-Gravel

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!

ACCEPTED SOLUTION

Accepted Solutions
Rajesh_Sayana
13-Aquamarine
(To:Quannd)

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

  

View solution in original post

2 REPLIES 2
Rajesh_Sayana
13-Aquamarine
(To:Quannd)

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

  

Thanks Rajesh!

That works.

Announcements


Top Tags