Example #1
0
        public void OpenImage(string imgPath)
        {
            if (File.Exists(imgPath))
            {
                ImgForm frm = new ImgForm(imgPath);

                frm.TopLevel = true;
                frm.ShowDialog();
                frm.BringToFront();
            }
        }
Example #2
0
        /// <summary>
        /// 获取服务器图片 并展示
        /// </summary>
        /// <param name="imgPath"></param>
        public void OpenRemoteImage(string imgPath)
        {
            string fileName = imgPath.Substring(imgPath.LastIndexOf("/") + 1);
            string FilePath = AppDomain.CurrentDomain.BaseDirectory + "htm\\Source\\default\\img";

            if (Directory.Exists(FilePath))
            {
                Directory.CreateDirectory(FilePath);
            }
            //FilePath = FilePath + "\\" + fileName;
            TempFile.DownLoad_Image(imgPath, ref FilePath);
            if (File.Exists(FilePath))
            {
                ImgForm frm = new ImgForm(FilePath);

                frm.TopLevel = true;
                frm.ShowDialog();
                frm.BringToFront();
            }
        }