Documentation > CMS Template API Library > ImgResult
CrownPeak.CMSAPI.ImgResult
Returned by some calls to encapsulate the result of the operation. Contains the resulting image and properties to tell whether there was an error and to provide an error message
Name | Description | Type |
---|---|---|
ErrorMessage | Gets or sets the error message. |
Property |
HasError | Gets or sets a value indicating whether this instance has error. |
Property |
Img | Gets or sets the img. |
Property |
Code Example
C#
Sample:
// resize the image to 50x50 and call it a thumbnail ImgResult res = img.CreateThumbnail("my_photo_thumbnail", 50, 50); if (!res.HasError) { context.Error = "Upload Error creating thumbnail on " + value + " error: " + res.ErrorMessage; }