Exemplo n.º 1
0
 private void Garch_LineLoadFile(object sender, EventArgs e)
 {
     strpage.Clear();
     try {
         if (ImgView.Image == null && Clscheck.ArchPos == null ||
             ImgView.Image == null && Clscheck.ArchPos.Trim().Length <= 0)
         {
             if (Clscheck.task)
             {
                 return;
             }
             Clscheck.task         = true;
             Clscheck.ArchPos      = gArch.ArchPos;
             Clscheck.Archid       = gArch.Archid;
             Clscheck.RegPage      = gArch.ArchRegPages;
             Clscheck.FileNametmp  = gArch.ArchImgFile;
             toolArchno.Text       = string.Format("当前卷号:{0}", Clscheck.ArchPos);
             gArch.butLoad.Enabled = false;
             LoadArch();
             ImgView.Focus();
             return;
         }
         MessageBox.Show("请退出当前卷再进行操作!");
         gArch.Focus();
     } catch (Exception exception) {
         Cledata();
         MessageBox.Show(exception.ToString());
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ImgView.SetImage(new NSUrl(Photo));

            BtnHover.TouchUpInside += BtnHover_TouchUpInside;
        }
Exemplo n.º 3
0
        void CreateBindings()
        {
            this.SetBinding(
                () => ViewModel.Text,
                () => TxtView.Text,
                BindingMode.TwoWay);

            ImgView.SetImageResource(GetImageFromFilename(ViewModel.ImageFilename));
        }
Exemplo n.º 4
0
 private void toolInster_Click(object sender, EventArgs e)
 {
     if (this.ImgView.Image != null)
     {
         if (this.oFdInsterFile.ShowDialog() == DialogResult.OK)
         {
             Himg._Insterpage(this.oFdInsterFile.FileName);
         }
     }
     ImgView.Focus();
 }
Exemplo n.º 5
0
        public void GetCutThumbnailImg_Tests()
        {
            Image image  = Image.FromFile(imagePath);
            var   result = ImgView.Instance().GetThumbnailCutImg(image, ViewMode.None, 100, 90);

            outputFilePath = Path.Combine($"{filePath}output\\", "ImgView-" + Guid.NewGuid().ToString("N") + ".jpg");
            result.Save(outputFilePath);


            Assert.Equals(result, "ffa9a1a1");
        }
Exemplo n.º 6
0
        private void toolGotoPages_Click(object sender, EventArgs e)
        {
            Frmnum nu = new Frmnum();

            nu.ShowDialog();
            int page = Frmnum.Page;

            if (page > 0 && page <= ClsTwain.MaxPage)
            {
                Himg._Gotopage(Frmnum.Page);
            }
            ImgView.Focus();
        }
Exemplo n.º 7
0
        void ReleaseDesignerOutlets()
        {
            if (ImgView != null)
            {
                ImgView.Dispose();
                ImgView = null;
            }

            if (LabelTitle != null)
            {
                LabelTitle.Dispose();
                LabelTitle = null;
            }
        }
Exemplo n.º 8
0
 private void toolDelPages_Click(object sender, EventArgs e)
 {
     Himg._Delepage();
     if (ImgView.Image == null)
     {
         try {
             if (ftp.FtpCheckFile(Path.Combine(T_ConFigure.gArchScanPath, ClsTwain.ArchPos,
                                               T_ConFigure.ScanTempFile)))
             {
                 ftp.FtpDelFile(Path.Combine(T_ConFigure.gArchScanPath, ClsTwain.ArchPos,
                                             T_ConFigure.ScanTempFile));
             }
         } catch { }
     }
     ImgView.Focus();
 }
        void ReleaseDesignerOutlets()
        {
            if (AddressOne != null)
            {
                AddressOne.Dispose();
                AddressOne = null;
            }

            if (AddressThree != null)
            {
                AddressThree.Dispose();
                AddressThree = null;
            }

            if (AddressTwo != null)
            {
                AddressTwo.Dispose();
                AddressTwo = null;
            }

            if (Heading != null)
            {
                Heading.Dispose();
                Heading = null;
            }

            if (HeadingSub != null)
            {
                HeadingSub.Dispose();
                HeadingSub = null;
            }

            if (ImgView != null)
            {
                ImgView.Dispose();
                ImgView = null;
            }

            if (MainViewCell != null)
            {
                MainViewCell.Dispose();
                MainViewCell = null;
            }
        }
Exemplo n.º 10
0
 private void toolScan_Click(object sender, EventArgs e)
 {
     if (ClsTwain.ArchPos == null || ClsTwain.ArchPos.Trim().Length <= 0)
     {
         MessageBox.Show("请先加载相关案卷!");
         return;
     }
     try {
         if (!ClsTwain.Scanbool)
         {
             Twscan();
         }
     } catch (Exception ex) {
         MessageBox.Show("请检查是否安装驱动或连接扫描仪!" + ex.ToString());
     } finally {
         ClsTwain.Scanbool = false;
     }
     ImgView.Focus();
 }
Exemplo n.º 11
0
 private void Garch_LineLoadFile(object sender, EventArgs e)
 {
     try {
         if (ImgView.Image == null && ClsTwain.ArchPos == null ||
             ImgView.Image == null && ClsTwain.ArchPos.Trim().Length <= 0)
         {
             ClsTwain.ArchPos = gArch.ArchPos;
             ClsTwain.Archid  = gArch.Archid;
             ClsTwain.RegPage = gArch.ArchRegPages;
             labArchNo.Text   = string.Format("当前卷号:{0}", ClsTwain.ArchPos);
             LoadArch();
             ImgView.Focus();
             return;
         }
         MessageBox.Show("请退出当前卷再进行操作!");
         gArch.Focus();
     } catch (Exception ex) {
         Cledata();
         MessageBox.Show(ex.ToString());
     }
 }
Exemplo n.º 12
0
        public static List <Block> GetContent(string txt)
        {
            txt = txt.Replace("<div", "<p").Replace("</div>", "</p>");
            var list = new List <Block>();

            var regEx = new Regex(
                @"(\<p.*?\>)(?<text>.*?)(\<\/p\>|$)",
                RegexOptions.IgnoreCase | RegexOptions.Singleline);

            foreach (Match match in regEx.Matches(txt))
            {
                var item = match.Groups["text"].Value.Trim();
                if (item.Contains("<img"))
                {
                    var paragraph = new Paragraph();
                    var regImg    = new Regex(
                        @"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>",
                        RegexOptions.IgnoreCase);
                    foreach (Match matchImg in regImg.Matches(item))
                    {
                        var image = new Image();
                        image.Source              = new BitmapImage(new Uri(matchImg.Groups["imgUrl"].Value.Trim()));
                        image.Stretch             = Stretch.None;
                        image.HorizontalAlignment = HorizontalAlignment.Center;
                        image.Tapped             += async(sender, args) =>
                        {
                            ImgView cd = new ImgView();
                            cd.Source  = new BitmapImage(new Uri(matchImg.Groups["imgUrl"].Value));
                            cd.Tapped += (o, eventArgs) =>
                            {
                                cd.Hide();
                            };
                            cd.RightTapped += async(o, eventArgs) =>
                            {
                                await Launcher.LaunchUriAsync(new Uri(matchImg.Groups["imgUrl"].Value));
                            };
                            await cd.ShowAsync();
                        };
                        var container = new InlineUIContainer();
                        container.Child = image;
                        paragraph.Inlines.Add(container);
                    }
                    list.Add(paragraph);
                }
                else if (item.Contains("<span"))
                {
                    var paragraph = new Paragraph();
                    paragraph.Inlines.Add(new Run()
                    {
                        Text       = NoHTML(item),
                        Foreground = new SolidColorBrush(Color.FromArgb(255, 34, 34, 34)), FontSize = 16
                    });
                    paragraph.LineHeight = 26;
                    list.Add(paragraph);
                }
                else
                {
                    var paragraph = new Paragraph();
                    paragraph.Inlines.Add(new Run()
                    {
                        Text       = NoHTML(item),
                        Foreground = new SolidColorBrush(Color.FromArgb(255, 34, 34, 34)), FontSize = 16
                    });
                    paragraph.LineHeight = 26;
                    list.Add(paragraph);
                }
            }

            return(list);
        }
Exemplo n.º 13
0
 private void UcContents1_LineFocus(object sender, EventArgs e)
 {
     ImgView.Focus();
 }
Exemplo n.º 14
0
 private void toolImgSmall_Click(object sender, EventArgs e)
 {
     Himg._Sizeimge(0);
     ImgView.Focus();
 }
Exemplo n.º 15
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreviewCtl));
     this.pdfViewer      = new PdfiumViewer.PdfViewer();
     this.webBrowser     = new System.Windows.Forms.WebBrowser();
     this.axWMP          = new AxWMPLib.AxWindowsMediaPlayer();
     this.videoPlayerCtl = new VideoPlayer.VideoPlayerCtl();
     this.imgView        = new cfw.ImgView();
     this.docView        = new cfw.DocView();
     this.zipView        = new cfw.ZipView();
     this.fileView       = new FileViewCtl.FileView();
     ((System.ComponentModel.ISupportInitialize)(this.axWMP)).BeginInit();
     this.SuspendLayout();
     //
     // pdfViewer
     //
     this.pdfViewer.Location = new System.Drawing.Point(3, 3);
     this.pdfViewer.Name     = "pdfViewer";
     this.pdfViewer.Size     = new System.Drawing.Size(122, 27);
     this.pdfViewer.TabIndex = 0;
     this.pdfViewer.Visible  = false;
     //
     // webBrowser
     //
     this.webBrowser.Location    = new System.Drawing.Point(5, 71);
     this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
     this.webBrowser.Name        = "webBrowser";
     this.webBrowser.Size        = new System.Drawing.Size(120, 20);
     this.webBrowser.TabIndex    = 5;
     this.webBrowser.Visible     = false;
     //
     // axWMP
     //
     this.axWMP.Enabled  = true;
     this.axWMP.Location = new System.Drawing.Point(131, 101);
     this.axWMP.Name     = "axWMP";
     this.axWMP.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWMP.OcxState")));
     this.axWMP.Size     = new System.Drawing.Size(116, 34);
     this.axWMP.TabIndex = 10;
     this.axWMP.Visible  = false;
     //
     // videoPlayerCtl
     //
     this.videoPlayerCtl.Location    = new System.Drawing.Point(3, 101);
     this.videoPlayerCtl.MinimumSize = new System.Drawing.Size(100, 20);
     this.videoPlayerCtl.Name        = "videoPlayerCtl";
     this.videoPlayerCtl.Size        = new System.Drawing.Size(116, 57);
     this.videoPlayerCtl.TabIndex    = 9;
     this.videoPlayerCtl.URL         = "";
     this.videoPlayerCtl.Visible     = false;
     //
     // imgView
     //
     this.imgView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.imgView.Location    = new System.Drawing.Point(131, 3);
     this.imgView.Margin      = new System.Windows.Forms.Padding(0);
     this.imgView.Name        = "imgView";
     this.imgView.Size        = new System.Drawing.Size(116, 32);
     this.imgView.TabIndex    = 7;
     this.imgView.Visible     = false;
     //
     // docView
     //
     this.docView.Location = new System.Drawing.Point(131, 70);
     this.docView.Name     = "docView";
     this.docView.Size     = new System.Drawing.Size(116, 21);
     this.docView.TabIndex = 6;
     this.docView.Visible  = false;
     //
     // zipView
     //
     this.zipView.Location = new System.Drawing.Point(131, 36);
     this.zipView.Name     = "zipView";
     this.zipView.Size     = new System.Drawing.Size(116, 27);
     this.zipView.TabIndex = 3;
     this.zipView.Visible  = false;
     //
     // fileView
     //
     this.fileView.Location = new System.Drawing.Point(3, 36);
     this.fileView.Margin   = new System.Windows.Forms.Padding(0, 3, 0, 3);
     this.fileView.Name     = "fileView";
     this.fileView.Size     = new System.Drawing.Size(122, 29);
     this.fileView.TabIndex = 2;
     this.fileView.Visible  = false;
     //
     // PreviewCtl
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.axWMP);
     this.Controls.Add(this.videoPlayerCtl);
     this.Controls.Add(this.imgView);
     this.Controls.Add(this.docView);
     this.Controls.Add(this.webBrowser);
     this.Controls.Add(this.zipView);
     this.Controls.Add(this.fileView);
     this.Controls.Add(this.pdfViewer);
     this.Name = "PreviewCtl";
     this.Size = new System.Drawing.Size(256, 161);
     ((System.ComponentModel.ISupportInitialize)(this.axWMP)).EndInit();
     this.ResumeLayout(false);
 }
Exemplo n.º 16
0
 private void toolImgRoter_Click(object sender, EventArgs e)
 {
     Himg._Roteimage(1);
     ImgView.Focus();
 }
Exemplo n.º 17
0
 private void toolPagesDown_Click(object sender, EventArgs e)
 {
     Himg._Pagenext(1);
     ImgView.Focus();
 }