Example #1
0
 /// <summary>
 /// 加载默认值
 /// </summary>
 private void LoadDisplay()
 {
     Task.Run(() => {
         this.wifiTxt.Text  = FormConfigUtil.WifiPath;
         this.localTxt.Text = FormConfigUtil.LocationPath;
         this.logTxt.Text   = FormConfigUtil.LogPath;
         this.ipTxt.Text    = FormConfigUtil.IpPath;
         this.countTxt.Text = FormConfigUtil.PrintCount.ToString();
         var list           = new List <object> {
             new { key = "默认居中", value = "默认居中" }
         };
         this.localComboBox.DataSource    = list;
         this.localComboBox.ValueMember   = "value";
         this.localComboBox.DisplayMember = "key";
         this.localComboBox.SelectedValue = FormConfigUtil.ImgLocation;
         this.pageSize     = ImageSizeUtil.ConverntPaperSizeName(FormConfigUtil.PageSize);
         this.landscape    = FormConfigUtil.Landscape;
         this.marginLeft   = FormConfigUtil.MarginLeft;
         this.marginRight  = FormConfigUtil.MarginRight;
         this.marginTop    = FormConfigUtil.MarginTop;
         this.marginBottom = FormConfigUtil.MarginBottom;
         this.printDocument.DefaultPageSettings.PaperSize      = FormConfigUtil.GetPaperSize(printDocument, pageSize);
         this.printDocument.DefaultPageSettings.Margins.Top    = this.marginTop;
         this.printDocument.DefaultPageSettings.Margins.Left   = this.marginLeft;
         this.printDocument.DefaultPageSettings.Margins.Right  = this.marginRight;
         this.printDocument.DefaultPageSettings.Margins.Bottom = this.marginBottom;
         this.portTxt.Text = FormConfigUtil.Host;
     });
 }
Example #2
0
        private void InitData(List <ImageEditParam> imgParam, string pagerSize)
        {
            var widthD  = this.detailPic.Width;
            var heightD = this.detailPic.Height;

            this.Images = imgParam.Select(x => new ImageEditParam {
                YuanImg       = x.YuanImg,
                DetailImg     = ImageUtil.CreateThumbnailImage(x.ScreenshotImg, widthD, heightD),
                ImagePath     = x.ImagePath,
                ImageType     = x.ImageType,
                SuoImg        = ImageUtil.CreateThumbnailImage(x.ScreenshotImg, width, height),
                ScreenshotImg = x.ScreenshotImg,
                IsPrint       = true
            }).ToList();
            //将pageSize转换成A3类型的名称
            this.PagerSize     = ImageSizeUtil.ConverntPaperSizeName(pagerSize);
            this.countTxt.Text = FormConfigUtil.PrintCount.ToString();
        }