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(); }
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(); }