Table of Contents


PhotoGallery Helper

This utility class allows you to add photos to Magentrix PhotoGallery via Active Classes.

Methods

Method nameArgumentsDescription
CreatePhotoGallery 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

NameDescription
MaxHeightinteger, maximum number of pixels for height of the Preview image (the image may be cropped or scaled) - default: 340
MaxWidthinteger, optional value - maximum number of pixels for width of the Preview image (the image may be cropped or scaled)
SaveOriginalboolean (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");