Пример #1
0
        /// <summary>
        ///  根据节点添加缩略图
        /// </summary>
        /// <param name="images"></param>
        /// <param name="node"></param>
        protected virtual void AddImageThumbnailByXmlNode(IList <ImageThumbnailInfo> images, XmlNode node)
        {
            var iti = new ImageThumbnailInfo();

            if (node != null && node.Attributes != null)
            {
                iti.Flag   = node.Attributes["Flag"].Value;
                iti.Width  = Convert.ToInt32(node.Attributes["Width"].Value);
                iti.Height = Convert.ToInt32(node.Attributes["Height"].Value);
                iti.IsUsed = node.Attributes["IsUsed"] == null || Convert.ToBoolean(node.Attributes["Height"].Value);
            }
            images.Add(iti);
        }
Пример #2
0
 /// <summary>
 /// 创建缩略图名称
 /// </summary>
 /// <param name="fileName"></param>
 /// <param name="imageThumbnail"></param>
 /// <returns></returns>
 protected virtual string CreateThumbnailName(string fileName, ImageThumbnailInfo imageThumbnail)
 {
     return(string.Format("{0}.{1}{2}", fileName, imageThumbnail.Flag, Path.GetExtension(fileName)));
 }