Ejemplo n.º 1
0
        /// <summary>
        /// 初始化原图
        /// </summary>
        void InitOriginalImagePath()
        {
            string  imagepath = "/admin/images/article_small.gif";
            Article a         = ArticleHelper.GetArticle(ArticleID);

            if (a.Thumbnail != null && a.Thumbnail.Length > 0)
            {
                string path = a.Thumbnail;
                path = Server.MapPath(path);
                string filename = Path.GetFileNameWithoutExtension(path);
                if (!filename.Contains("_S") && File.Exists(path))
                {
                    imagepath = a.Thumbnail;
                }
                if (filename.Contains("_S"))
                {
                    path = path.Replace("_S", "");
                    if (File.Exists(path))
                    {
                        imagepath = a.Thumbnail.Replace("_S", "");
                    }
                }
            }
            OriginalImagePath = imagepath;
            ThumbnailImages  imageHelp = new ThumbnailImages();
            ImageInformation imageInfo = (ImageInformation)imageHelp.GetImageInfo(Server.MapPath(OriginalImagePath));

            width  = imageInfo.Width;
            height = imageInfo.Height;
        }
Ejemplo n.º 2
0
        void InitImageInfo()
        {
            ThumbnailImages  imageHelp = new ThumbnailImages();
            ImageInformation imageInfo = (ImageInformation)imageHelp.GetImageInfo(Server.MapPath(OriginalImagePath));

            width  = imageInfo.Width;
            height = imageInfo.Height;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化原图
        /// </summary>
        void InitOriginalImagePath()
        {
            string imgEgitNmame = Request.QueryString["imgEdit"] == null ? "" : Request.QueryString["imgEdit"];

            if (imgEgitNmame != "")
            {
                OriginalImagePath           = ImagePaths + "/" + imgEgitNmame;
                localHostPaneUpload.Visible = false;
                imgBackground.ImageUrl      = OriginalImagePath;
                ThumbnailImages  imageHelp = new ThumbnailImages();
                ImageInformation imageInfo = (ImageInformation)imageHelp.GetImageInfo(Server.MapPath(OriginalImagePath));
                width  = imageInfo.Width;
                height = imageInfo.Height;
                Page.ClientScript.RegisterStartupScript(typeof(UploadThumbnail), "Step()", "<script type='text/javascript'>Step();</script>");
            }
        }