Example #1
0
 /// <summary>
 /// if width and height can not be determined, returns a new size with isEmpty = true.
 /// </summary>
 /// <param name="fileUrl"></param>
 /// <param name="displayBoxWidth"></param>
 /// <param name="displayBoxHeight"></param>
 /// <returns></returns>
 public static System.Drawing.Size getDisplayWidthAndHeight(string fileUrl, int displayBoxWidth, int displayBoxHeight)
 {
     return(BaseShowThumbnailPage2.getDisplayWidthAndHeight(
                getBaseShowThumbnailPageParameters(),
                fileUrl,
                displayBoxWidth,
                displayBoxHeight));
 }
Example #2
0
        /// <summary>
        /// if width and height can not be determined, returns a new size with isEmpty = true.
        /// </summary>
        /// <param name="resource"></param>
        /// <param name="displayBoxWidth"></param>
        /// <param name="displayBoxHeight"></param>
        /// <returns></returns>
        public static System.Drawing.Size getDisplayWidthAndHeight(CmsLocalImageOnDisk resource, int displayBoxWidth, int displayBoxHeight)
        {
            int[] actualSize = resource.getImageDimensions();
            if (actualSize.Length == 2)
            {
                System.Drawing.Size ret = Thumbnail2.calculateDisplayWidthAndHeight(actualSize, displayBoxWidth, displayBoxHeight);
                if (!ret.IsEmpty)
                {
                    return(ret);
                }
            }

            return(BaseShowThumbnailPage2.getDisplayWidthAndHeight(
                       getBaseShowThumbnailPageParameters(),
                       resource.getUrl(System.Web.HttpContext.Current),
                       displayBoxWidth,
                       displayBoxHeight));
        }