示例#1
0
        protected override EncoderParameter[] GetEncoderParams(ref ScrapBase scrap)
        {
            List <EncoderParameter> list = new List <EncoderParameter>();

            if (this.ShowPreview)
            {
                ImageJpegPreviewPanel panel;
                if (base.HaveMargin)
                {
                    panel = new ImageJpegPreviewPanel(this, scrap.GetViewImage(), base.GetImageCodecInfo());
                }
                else
                {
                    panel = new ImageJpegPreviewPanel(this, (Bitmap)scrap.Image.Clone(), base.GetImageCodecInfo());
                }
                if (panel.ShowDialog(scrap) != DialogResult.OK)
                {
                    return(null);
                }
                CImageJpegStyleItem styleItem = (CImageJpegStyleItem)panel.StyleItem;
                list.Add(new EncoderParameter(Encoder.Quality, (long)styleItem.Quality));
            }
            else
            {
                list.Add(new EncoderParameter(Encoder.Quality, (long)this.Quality));
            }
            return(list.ToArray());
        }
        // Token: 0x060004D7 RID: 1239 RVA: 0x000227FC File Offset: 0x000209FC
        protected override object GetStyleFromForm()
        {
            var cimageJpegStyleItem = new CImageJpegStyleItem
            {
                SaveFolder  = txtFolder.Text,
                Quality     = barQuality.Value,
                ShowPreview = chkShowParam.Checked,
                HaveMargin  = chkWindow.Checked,
                CopyPath    = chkCopy.Checked
            };

            if (rdoSaveAs.Checked)
            {
                cimageJpegStyleItem.FileNameType = CImageStyleItem.EnumFileName.SaveAs;
            }
            else if (rdoScrapName.Checked)
            {
                cimageJpegStyleItem.FileNameType = CImageStyleItem.EnumFileName.ScrapName;
            }
            else
            {
                cimageJpegStyleItem.FileNameType = CImageStyleItem.EnumFileName.UseName;
            }
            cimageJpegStyleItem.DupliType = (CImageStyleItem.EnumDupliType)cmbDupli.SelectedIndex;
            cimageJpegStyleItem.FileName  = txtName.Text;
            return(cimageJpegStyleItem);
        }
示例#3
0
        protected override void SetStyleToForm(object style)
        {
            CImageJpegStyleItem item = (CImageJpegStyleItem)style;

            this.InitializeComponent();
            this.Text                 = item.GetDisplayName();
            this.txtFolder.Text       = item.SaveFolder;
            this.barQuality.Value     = item.Quality;
            this.chkShowParam.Checked = item.ShowPreview;
            this.chkWindow.Checked    = item.HaveMargin;
            this.chkCopy.Checked      = item.CopyPath;
            switch (item.FileNameType)
            {
            case CImageStyleItem.EnumFileName.SaveAs:
                this.rdoSaveAs.Checked = true;
                break;

            case CImageStyleItem.EnumFileName.ScrapName:
                this.rdoScrapName.Checked = true;
                break;

            case CImageStyleItem.EnumFileName.UseName:
                this.rdoName.Checked = true;
                break;
            }
            this.cmbDupli.SelectedIndex = (int)item.DupliType;
            this.txtName.Text           = item.FileName;
        }
示例#4
0
        protected override void SetTunedStyleItem(CStyleItem newOwn)
        {
            CImageJpegStyleItem item = (CImageJpegStyleItem)newOwn;

            base.SaveFolder   = item.SaveFolder;
            this.Quality      = item.Quality;
            this.ShowPreview  = item.ShowPreview;
            base.HaveMargin   = item.HaveMargin;
            base.CopyPath     = item.CopyPath;
            base.FileNameType = item.FileNameType;
            base.DupliType    = item.DupliType;
            base.FileName     = item.FileName;
        }
示例#5
0
        protected override void SetStyleToForm(object style)
        {
            CImageJpegStyleItem item = (CImageJpegStyleItem)style;

            this.InitializeComponent();
            this.Text             = item.GetDisplayName();
            this.barQuality.Value = item.Quality;
            this.lastqvalue       = this.barQuality.Value;
            try
            {
                this.tempimg = Path.GetTempFileName();
            }
            catch
            {
                this.tempimg = "";
            }
            this.timer1.Start();
        }
 // Token: 0x060004D5 RID: 1237 RVA: 0x00022712 File Offset: 0x00020912
 public ImageJpegStyleItemPanel(CImageJpegStyleItem item) : base(item)
 {
 }
示例#7
0
 public ImageJpegPreviewPanel(CImageJpegStyleItem item, Image img, ImageCodecInfo icodec) : base(item)
 {
     this._img    = img;
     this._icodec = icodec;
     this.UpdatePreview();
 }