예제 #1
0
 public TemporarPass(Visitor parent)
 {
     InitEmployee = new Employee(this);
     InitEmployees(InitEmployee);
     Parent     = parent;
     DocumentTP = new DocumentPrint(this);
 }
예제 #2
0
 public void Print(List <IPrintPaperData> printData)
 {
     PrintPaperData = printData;
     DocumentPrint.Print();
     DocumentPrint.Dispose();
     GC.Collect();
 }
 /// <summary>
 /// 打印
 /// </summary>
 /// <param name="printfile">照片路径</param>
 public void Print(string printfile)
 {
     PrintBitmap = ImageHepler.LoadBitmap(printfile);
     DocumentPrint.Print();
     DocumentPrint.Dispose();
     GC.Collect();
 }
예제 #4
0
        private void btnDocumentDic_Click(object sender, EventArgs e)
        {
            string tempalte = System.AppDomain.CurrentDomain.BaseDirectory + "\\Template\\Template.xml";
            Dictionary <string, object> dic = GetDataSource();
            IPrint instance = new DocumentPrint(tempalte, "", dic);

            instance.Init().Print();
        }
예제 #5
0
 TemporarPass(int?id, DateTime validWith, DateTime validUntil,
              string purposeOfIssuance, Employee passIssued, Visitor visitor = null)
 {
     _initId                = _id = id;
     _initValidWith         = _validWith = validWith;
     _initValidUntil        = _validUntil = validUntil;
     _initPurposeOfIssuance = _purposeOfIssuance = purposeOfIssuance;
     _initPassIssued        = _passIssued = passIssued;
     _initVisitor           = _visitor = visitor;
     DocumentTP             = new DocumentPrint(this);
 }
        public virtual void Dispose(bool isDisplsed)
        {
            if (isDisplsed)
            {
                return;
            }

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

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

            MemoryHepler.FlushMemory();
        }
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="bmp">位图</param>
        /// <param name="isCut">是否剪裁</param>
        /// <param name="tp">是否置换打印区域</param>
        public void Print(Bitmap bmp, bool isCut, bool tp)
        {
            if (bmp == null)
            {
                return;
            }
            ImageCut = isCut;
            IsTp     = tp;

            PrintBitmap = new Bitmap(bmp.Width, bmp.Height);

            var g = Graphics.FromImage(PrintBitmap);

            g.DrawImage(bmp, 0, 0, PrintBitmap.Width, PrintBitmap.Height);

            g.Dispose();

            DocumentPrint.Print();
            DocumentPrint.Dispose();
            GC.Collect();
        }