public static IMessageImage Convert(Thumbnail2 authorPhoto) { return(new Common.MessageImage { Height = authorPhoto.Height, Width = authorPhoto.Width, Url = authorPhoto.Url, }); }
/// <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)); }