예제 #1
0
 /// <summary>
 /// Function to reset style of photo region
 /// </summary>
 /// <param name="photoRegion">photo region whose style to be reset</param>
 public static void ResetStyle(PhotoRegion photoRegion)
 {
     if (photoRegion != null)
     {
         photoRegion.ResetStyle();
     }
 }
예제 #2
0
        /// <summary>
        /// Function to resize photo region and assign new photo to person
        /// </summary>
        /// <param name="photoRegion">region to be resized</param>
        /// <param name="resizeFactor">New width of the photo regions</param>
        /// <param name="aspectRatio">Ratio will be used to calculate new height</param>
        private static void ResizePhotoRegion(PhotoRegion photoRegion, double resizeFactor, double aspectRatio)
        {
            // Calculates new height as per aspect ratio
            double newHeight = resizeFactor / aspectRatio;

            // assign new size
            photoRegion.Width = resizeFactor;
            photoRegion.Height = newHeight;
        }
예제 #3
0
 /// <summary>
 /// Function to remove photo region
 /// </summary>
 /// <param name="photoRegionsContainer">Container which contains photo regions</param>
 /// <param name="photoRegion">photo region to remove</param>
 public static void RemovePhotoRegion(Panel photoRegionsContainer, PhotoRegion photoRegion)
 {
     if (photoRegionsContainer != null && photoRegion != null)
     {
         photoRegionsContainer.Children.Remove(photoRegion);
     }
 }