/// <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; }
void InitImageInfo() { ThumbnailImages imageHelp = new ThumbnailImages(); ImageInformation imageInfo = (ImageInformation)imageHelp.GetImageInfo(Server.MapPath(OriginalImagePath)); width = imageInfo.Width; height = imageInfo.Height; }
/// <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>"); } }