PhotoGallery Helper
This utility class allows you to add photos to Magentrix PhotoGallery via Active Classes.
Methods
| Method name | Arguments | Description |
|---|
| Create | PhotoGallery record, byte[] fileBytes, string fileNameWithExtension, PhotoGallerySetting setting | Create a new PhotoGallery Photo which is related to a specific Entity record in your Magentrix platform. This methods throws DatabaseException if there are validation or other problems.
setting argument is optional. |
| | | |
PhotoGallerySetting
| Name | Description |
|---|
| MaxHeight | integer, maximum number of pixels for height of the Preview image (the image may be cropped or scaled) - default: 340 |
| MaxWidth | integer, optional value - maximum number of pixels for width of the Preview image (the image may be cropped or scaled) |
| SaveOriginal | boolean (true/false) - If set to true the original image will also be saved along with Preview and Thumbnail format. |
The following example demonstrates how you can use the PhotoGalleryHelper class:
// Populate the Record ID of record to which the photo needs to be attached, in ReferenceIdvar photo = new PhotoGallery {
Name = "MyPhoto",
Description = "My image description",
ReferenceId = "01900000000001F0001"
};
PhotoGalleryHelper.Create(photo, bytes, "myNewPhoto.jpg");