Documentation > CMS Template API Library > ShowAcquireParams > AddAdditionalImage(String,Int32,Int32,Int32,Boolean)

AddAdditionalImage

Add an image to be scaled to the size specified when an image is selected or uploaded with the Input.ShowAcquireImage control. Note: Add the optional displaySizeName parameter to the ShowAcquireImage call if you want to display one of these images after the upload instead of the original

public System.Void AddAdditionalImage(String,Int32,Int32,Int32,Boolean)

Parameters

NameDescriptionType
name The name that will be used to refer to the size later System.String
width The desired width System.Int32
height The desired width System.Int32
qualityPercent The desired quality. Default is 75 percent System.Int32
preserveAspectRatio Optional: Pass false if you want the thumbnail to be generated with exactly the size of the passed in width and height. Available in builds 3451 and up. System.Boolean

Code Example

C#

Sample:

             
             
              ShowAcquireParams acquireImageParams = new ShowAcquireParams();
              acquireImageParams.Extensions = Util.MakeList( "png", "gif",  "jpeg", "jpg");
              acquireImageParams.AddAdditionalImage("my_photo_300",300,300);
              acquireImageParams.AddAdditionalImage("my_photo_100",100,100);
            
              Input.ShowAcquireImage("My Photo", "my_photo_thumbnail", acquireImageParams, displaySizeName: "my_photo_300");
                   
             
             

Connect with Crownpeak