private bool InvalidCheck() { AllParam allp = m_iPrinterChange.GetAllParam(); float pgW = allp.PrinterSetting.sBaseSetting.fPaperWidth; float pgH = allp.PrinterSetting.sBaseSetting.fPaperHeight; float realPgW = PubFunc.CalcRealJobWidth(pgW, this.m_iPrinterChange.GetAllParam()); float JobW = this.m_PreviewJob.JobSize.Width; string info = string.Empty; if (JobW > realPgW) { info += SErrorCode.GetResString("Software_MediaTooSmall"); MessageBox.Show(info, ResString.GetProductName(), MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(true); }
private void UpdatePrintingJobInfo(UILengthUnit unit, SPrtFileInfo jobInfo) { float width = 0; if (jobInfo.sFreSetting.nResolutionX != 0) { width = (float)jobInfo.sImageInfo.nImageWidth / (float)(jobInfo.sFreSetting.nResolutionX); width = PubFunc.CalcRealJobWidth(width, this.m_iPrinterChange.GetAllParam()); //width = UIPreference.ToDisplayLength(unit,width); } float height = 0; if (jobInfo.sFreSetting.nResolutionY != 0) { height = (float)jobInfo.sImageInfo.nImageHeight / (float)(jobInfo.sFreSetting.nResolutionY); //height = UIPreference.ToDisplayLength(unit,height); } UpdateJobInfoText(unit, width, height, jobInfo.sFreSetting.nResolutionX * jobInfo.sImageInfo.nImageResolutionX, jobInfo.sFreSetting.nResolutionY * jobInfo.sImageInfo.nImageResolutionY, jobInfo.sImageInfo.nImageColorDeep, jobInfo.sFreSetting.nPass, jobInfo.sFreSetting.nBidirection, null, 0); }
private void UpdateJobInfoText(UILengthUnit unit, float width, float height, int resX, int resY, int deep, int passnum, int direction, string filepath, int LangID) { string unitStr = ResString.GetUnitSuffixDispName(unit); string pass = ResString.GetDisplayPass(); string strSize = string.Format("{0}x{1} {2}", UIPreference.ToDisplayLength(unit, width).ToString("f1"), UIPreference.ToDisplayLength(unit, height).ToString("f1"), unitStr); if (this.m_iPrinterChange != null) { width = PubFunc.CalcRealJobWidth(width, this.m_iPrinterChange.GetAllParam()); } m_fArea = UIPreference.ToDisplayLength(UILengthUnit.Meter, width) * UIPreference.ToDisplayLength(UILengthUnit.Meter, height); string strRes = string.Format("{0}x{1}", (resX), (resY)); string strDeep; if (1 == deep) { strDeep = "Normal"; } else { strDeep = "High Quality"; } string strPass = string.Format("{0} {1}", passnum, pass); string strDir = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)direction); string sLangID = ""; if (LangID != 0xffff) { try { foreach (CultureInfo cInfo in CultureInfo.GetCultures(CultureTypes.AllCultures)) { if (cInfo.LCID == LangID) { sLangID = cInfo.EnglishName; break; } } } catch (Exception) { sLangID = ""; } } //DisplayName EnglishName m_sJobInfo = strSize + "\n" + strRes + "\n" + strDeep + "\n" + strPass + "\n" + strDir + "\n" + sLangID; m_sJobPath = filepath; unitStr = ResString.GetUnitSuffixDispName(UILengthUnit.Meter); string strEff = string.Empty; float efficient = 0; if (m_spendTime.TotalSeconds != 0) { efficient = (float)(m_fArea) / (float)m_spendTime.TotalHours; } if (efficient > 0) { strEff = efficient.ToString() + " " + unitStr + "2/h"; } this.m_LabelPrintingJobInfo.Text = strEff + "\n" + m_sJobInfo; this.m_LabelPrintingJobPath.Text = m_sJobPath; }
private void OnClipSettingChanged(object sender, System.EventArgs e) { if (isSetting) { return; } m_PreviewJob.Clips.XCnt = Convert.ToInt32(this.numericUpDownXCnt.Value); m_PreviewJob.Clips.YCnt = Convert.ToInt32(this.numericUpDownYCnt.Value); m_PreviewJob.Clips.XDis = Convert.ToInt32(UIPreference.ToInchLength(m_CurrentUnit, (float)this.numericUpDownXDis.Value) * m_PreviewJob.ResolutionX); m_PreviewJob.Clips.YDis = Convert.ToInt32(UIPreference.ToInchLength(m_CurrentUnit, (float)this.numericUpDownYDis.Value) * m_PreviewJob.ResolutionY); int infomask = 0; if (checkBoxJobSize.Checked) { infomask |= 0x00001; } else { infomask &= ~0x00001; } if (checkBoxResolution.Checked) { infomask |= 0x00010; } else { infomask &= ~0x00010; } if (checkBoxPassNum.Checked) { infomask |= 0x00100; } else { infomask &= ~0x00100; } if (checkBoxDirection.Checked) { infomask |= 0x01000; } else { infomask &= ~0x01000; } if (checkBoxFilepath.Checked) { infomask |= 0x10000; } else { infomask &= ~0x10000; } if (checkBoxVoltage.Checked) { infomask |= 0x100000; } else { infomask &= ~0x100000; } m_PreviewJob.Clips.AddtionInfoMask = infomask; m_PreviewJob.Clips.Note = this.textBoxFootNote.Text; // m_PreviewJob.Clips.NoteFontName = this.textBoxFootNote.Font.Name; // m_PreviewJob.Clips.NoteFontSize = this.textBoxFootNote.Font.Size; m_PreviewJob.Clips.NoteFont = this.textBoxFootNote.Font; if (m_PreviewJob.Clips.NotePosition == 1 || m_PreviewJob.Clips.NotePosition == 3) { m_PreviewJob.Clips.NoteMargin = Convert.ToInt32(UIPreference.ToInchLength(m_CurrentUnit, (float)this.numericUpDown_noteMargin.Value) * m_PreviewJob.ResolutionY); } else { m_PreviewJob.Clips.NoteMargin = Convert.ToInt32(UIPreference.ToInchLength(m_CurrentUnit, (float)this.numericUpDown_noteMargin.Value) * m_PreviewJob.ResolutionX); } if (m_PreviewJob.IsClip) { RectangleF disrect = new RectangleF((float)this.numericUpDownX.Value, (float)this.numericUpDownY.Value, (float)this.numericUpDownW.Value, (float)this.numericUpDownH.Value); RectangleF uirect = CalculateUIClipRec(disrect); RectangleF uirect1 = uirect; uirect1.Intersect(m_OldPrintingPreview.ImagePictureBox.ClientRectangle); if (!this.m_CliPRect.SetClipRectangle(uirect1))//(uirect1 != uirect) { RectangleF ClipRec = this.CalculateDisClipRec(m_CliPRect.rect); isSetting = true; this.numericUpDownX.Value = (decimal)ClipRec.X; this.numericUpDownY.Value = (decimal)ClipRec.Y; if ((decimal)ClipRec.Width < numericUpDownW.Minimum) { ClipRec.Width = (float)numericUpDownW.Minimum; } if ((decimal)ClipRec.Width > numericUpDownW.Maximum) { ClipRec.Width = (float)numericUpDownW.Maximum; } this.numericUpDownW.Value = (decimal)ClipRec.Width; if ((decimal)ClipRec.Width < numericUpDownH.Minimum) { ClipRec.Width = (float)numericUpDownH.Minimum; } if ((decimal)ClipRec.Width > numericUpDownH.Maximum) { ClipRec.Width = (float)numericUpDownH.Maximum; } UIPreference.SetValueAndClampWithMinMax(this.numericUpDownH, ClipRec.Height); isSetting = false; } // this.m_CliPRect.SetClipRectangle(uirect1); this.m_OldPrintingPreview.Refresh(); m_PreviewJob.Clips.ClipRect = CalculateRealClipRec(m_CliPRect.rect); } if (m_PreviewJob.IsTile) { AllParam allp = m_iPrinterChange.GetAllParam(); float pgW = allp.PrinterSetting.sBaseSetting.fPaperWidth; float pgH = allp.PrinterSetting.sBaseSetting.fPaperHeight; float realPgW = PubFunc.CalcRealJobWidth(pgW, this.m_iPrinterChange.GetAllParam()); float JobW = this.m_PreviewJob.JobSize.Width; if (JobW > realPgW) { isSetting = true; UIPreference.SetValueAndClampWithMinMax(this.numericUpDownXCnt, m_PreviewJob.Clips.CalcXMaxCount(Convert.ToInt32(realPgW * this.m_PreviewJob.ResolutionX))); isSetting = false; m_PreviewJob.Clips.XCnt = Convert.ToInt32(this.numericUpDownXCnt.Value); } } UpdatePreviewAndClipBox(); //GC.Collect(); }