• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Printing.PrintPageEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Drawing.Printing.PrintPageEventArgs的典型用法代码示例。如果您正苦于以下问题:C# PrintPageEventArgs类的具体用法?C# PrintPageEventArgs怎么用?C# PrintPageEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PrintPageEventArgs类属于System.Drawing.Printing命名空间,在下文中一共展示了PrintPageEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: m_printDocument_PrintPage

        void m_printDocument_PrintPage(object sender, PrintPageEventArgs e)
        {
            SelectedMealCollection colData = (SelectedMealCollection)this.FindResource("SelectedMealCollectionData");
            float leftMargin = e.MarginBounds.Left;
            float rightMargin = e.MarginBounds.Right;
            float topMargin = e.MarginBounds.Top;
          
            float yPos = leftMargin;
            float xPos = 0;
            float centrePos = 2 * (rightMargin - leftMargin) / 5;
            float rightPos =  4 * (rightMargin - leftMargin) / 5;
            int count = 0;

            System.Drawing.Font printFont = new System.Drawing.Font("Arial", 10);
            System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);

            // Work out the number of lines per page, using the MarginBounds.
            float linesPerPage = e.MarginBounds.Height / printFont.GetHeight(e.Graphics);
            float lineCount = 0;
            foreach (var selectedMeal in colData)
            {
                // calculate the next line position based on the height of the font according to the printing device
                yPos = topMargin + (count++ * printFont.GetHeight(e.Graphics));
                e.Graphics.DrawString(selectedMeal.Date, printFont, myBrush, xPos, yPos);
                lineCount++;
   
                yPos = topMargin + (count++ * printFont.GetHeight(e.Graphics));
                e.Graphics.DrawString(selectedMeal.Meal, printFont, myBrush, xPos + 20, yPos);

                lineCount++;

                if (lineCount > linesPerPage) { break; }
            }

            lineCount = 0;
            count = 0;

            SelectedIngredientsCollection ingredientData = (SelectedIngredientsCollection)this.FindResource("SelectedIngredientsCollectionData");

            foreach (SelectedIngredient ingredient in ingredientData)
            {               
                // calculate the next line position based on the height of the font according to the printing device
                yPos = topMargin + (count++ * printFont.GetHeight(e.Graphics));
                xPos = centrePos;
                if (lineCount > linesPerPage) xPos = rightPos;
                e.Graphics.DrawString(ingredient.Ingredient, printFont, myBrush, xPos, yPos);
                lineCount++;
            }

            // If there are more lines, print another page.
            if (lineCount > linesPerPage)
            {
           //     e.HasMorePages = true;
            }
            else
            {
                e.HasMorePages = false;
                myBrush.Dispose();
            }
        }
开发者ID:jscott7,项目名称:SuperMarketPlanner,代码行数:60,代码来源:MainWindow.xaml.cs


示例2: pdDocument_PrintPage

        void pdDocument_PrintPage(object sender, PrintPageEventArgs e)
        {
            int x = 10;
            int y = 80;
            e.Graphics.DrawString(binfo.tabName, new Font("Arial", 15), Brushes.Black, 150, 5);
            e.Graphics.DrawString(printType, new Font("Arial", 15), Brushes.Black, 50, 5);
            e.Graphics.DrawString(CommService.GetCompanyName(), new Font("Arial", 10), Brushes.Black, 40, 35);

            e.Graphics.DrawString("商品名称", new Font("Arial", 10), Brushes.Black, x, y);
            e.Graphics.DrawString("数量", new Font("Arial", 10), Brushes.Black, 120, y);
            e.Graphics.DrawString("单价", new Font("Arial", 10), Brushes.Black, 160, y);
            e.Graphics.DrawString("赠送", new Font("Arial", 10), Brushes.Black, 240, y);
            double sum = 0;
            for (int i = 0; i < billDetailInfos.Count; i++)
            {
                BillDetailInfo dInfo = billDetailInfos[i];
                e.Graphics.DrawString(dInfo.FoodCnName, new Font("Arial", 10), Brushes.Black, x, y + i * 25 + 20);
                e.Graphics.DrawString(dInfo.foodCount.ToString(), new Font("Arial", 10), Brushes.Black, 120, y + i * 25 + 20);
                e.Graphics.DrawString(dInfo.FoodPrice.ToString(), new Font("Arial", 10), Brushes.Black, 160, y + i * 25 + 20);
                e.Graphics.DrawString(dInfo.Handsel.ToString(), new Font("Arial", 10), Brushes.Black, 240, y + i * 25 + 20);
                sum += dInfo.FoodPrice * dInfo.foodCount;
            }

            e.Graphics.DrawString(string.Format("总额:{0}", sum + "元"), new Font("Arial", 10), Brushes.Black, 10, 50 + (billDetailInfos.Count + 2) * 25);
            e.Graphics.DrawString(string.Format("账单号:{0}", binfo.billKey), new Font("Arial", 10), Brushes.Black, 10, 50 + (billDetailInfos.Count + 3) * 25);
            e.Graphics.DrawString(string.Format("下单时间:{0}", binfo.billtime), new Font("Arial", 10), Brushes.Black, 10, 50 + (billDetailInfos.Count + 4) * 25);
        }
开发者ID:JimDeng,项目名称:WenJiaPC,代码行数:27,代码来源:KitchenBillPrinter.cs


示例3: OnEndPage

 public override void OnEndPage(
     PrintDocument document,
     PrintPageEventArgs e
     )
 {
     this.OriginController.OnEndPage(document, e);
 }
开发者ID:renyh1013,项目名称:dp2,代码行数:7,代码来源:NewPrintController.cs


示例4: PrintDocument_PrintPage

 private static void PrintDocument_PrintPage(object sender, PrintPageEventArgs e)
 {
     var g = e.Graphics;
     //欢迎文字
     var y = 0;
     var lineH = 25;
     var config = ConfigProfile.Instance;
     if (!config.Welcome.IsEmpty())
     {
         e.Graphics.DrawString(config.Welcome, printFont, Brushes.Black, new Point(65, y));
         y += lineH;
     }
     if (!config.DateTime.IsEmpty())
     {
         var dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
         e.Graphics.DrawString(dt, printTimeFont, Brushes.Black, new Point(40, y));
         y += lineH;
     }
     if (!config.Guide.IsEmpty())
     {
         e.Graphics.DrawString(config.Guide, printFont, Brushes.Black, new Point(52, y));
         y += lineH;
     }
     //二维码图像
     g.DrawImage(_barcodeImage, new Rectangle(45, y, IMAGE_SIZE, IMAGE_SIZE));
     DisposeImage();
 }
开发者ID:ysjr-2002,项目名称:BJ-Benz,代码行数:27,代码来源:BrotherPrinter.cs


示例5: OnPrintPage

		//Override the OnPrintPage to provide the printing logic for the document
		protected override void OnPrintPage(PrintPageEventArgs ev) 
		{
			base.OnPrintPage(ev);
			labelDocument.DocumentSizeXPixels = ev.PageBounds.Width;
			labelDocument.DocumentSizeYPixels = ev.PageBounds.Height;

			foreach (Structs.Competitor competitor in competitors)
			{
				PrintLabel label;
				try
				{
					label = labelDocument.GetLabel(labelCount);
				}
				catch (PrintLabelDoesNotExistException)
				{
					labelCount = 0;
					ev.HasMorePages = true;
					return;
				}
				printCompetitor(ev, competitor, label);
				labelCount++;    
			}


			ev.HasMorePages = false;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:27,代码来源:CPrintResultLabels.cs


示例6: PrintPage

        private void PrintPage(object o, PrintPageEventArgs e)
        {
            try
            {
            button1.Visible = false;
            int x = SystemInformation.WorkingArea.X;
            int y = SystemInformation.WorkingArea.Y;

            int width = this.Width;
            int height = this.Height;

            Rectangle bounds = new Rectangle(x, y, width, height);

            Bitmap img = new Bitmap(width, height);

            this.DrawToBitmap(img, bounds);
            string date = DateTime.Now.ToString("yyyyMMddhhmmss");

            //img.Save(date + ".bmp");
            //Point loc = new Point(100, 100);
            e.Graphics.DrawImage(img, bounds);
             }
             catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
开发者ID:vivektarwan,项目名称:JSSRISf,代码行数:27,代码来源:Printpatientinfo.cs


示例7: OnPrintPage

            protected override void OnPrintPage(PrintPageEventArgs e)
            {
                base.OnPrintPage(e);

                Stream pageToPrint = m_pages[m_currentPage];
                pageToPrint.Position = 0;

                // Load each page into a Metafile to draw it.
                using (Metafile pageMetaFile = new Metafile(pageToPrint))
                {
                    Rectangle adjustedRect = new Rectangle(
                            e.PageBounds.Left - (int)e.PageSettings.HardMarginX,
                            e.PageBounds.Top - (int)e.PageSettings.HardMarginY,
                            e.PageBounds.Width,
                            e.PageBounds.Height);

                    // Draw a white background for the report
                    e.Graphics.FillRectangle(Brushes.White, adjustedRect);

                    // Draw the report content
                    e.Graphics.DrawImage(pageMetaFile, adjustedRect);

                    // Prepare for next page.  Make sure we haven't hit the end.
                    m_currentPage++;
                    e.HasMorePages = m_currentPage < m_pages.Count;
                }
            }
开发者ID:FJSOTO,项目名称:Tienda-Plaza,代码行数:27,代码来源:AutoPrintCls.cs


示例8: pdDocument_PrintPage

 void pdDocument_PrintPage(object sender, PrintPageEventArgs e)
 {
     int x = 10;
     int y = 80;
     //double sx = Convert.ToDouble(tb_Cash.Text) + Convert.ToDouble(tb_Vesa.Text) + Convert.ToDouble(tb_Card.Text) + Convert.ToDouble(tb_cashCoupon.Text);
     e.Graphics.DrawString(bInfo.tabName, new Font("Arial", 20), Brushes.Black, 200, 5);
     e.Graphics.DrawString("消费小票", new Font("Arial", 20), Brushes.Black, 60, 5);
     e.Graphics.DrawString(CommService.GetCompanyName(), new Font("Arial", 10), Brushes.Black, 50, 40);
     //e.Graphics.DrawString(String.Format("房间号码:{0}",bInfo.billRmNo), new Font("Arial", 10), Brushes.Black, 10, 60);
     e.Graphics.DrawString("商品名称", new Font("Arial", 10), Brushes.Black, x, y);
     e.Graphics.DrawString("数量", new Font("Arial", 10), Brushes.Black, 120, y);
     e.Graphics.DrawString("单价", new Font("Arial", 10), Brushes.Black, 180, y);
     e.Graphics.DrawString("赠送", new Font("Arial", 10), Brushes.Black, 240, y);
     for (int i = 0; i < detailInfos.Count; i++)
     {
         BillDetailInfo dInfo = detailInfos[i];
         e.Graphics.DrawString(dInfo.FoodCnName, new Font("Arial", 10), Brushes.Black, x, y + i * 25 + 20);
         e.Graphics.DrawString(dInfo.foodCount.ToString(), new Font("Arial", 10), Brushes.Black, 120, y + i * 25 + 20);
         e.Graphics.DrawString(dInfo.FoodPrice.ToString(), new Font("Arial", 10), Brushes.Black, 190, y + i * 25 + 20);
         e.Graphics.DrawString(dInfo.Handsel.ToString(), new Font("Arial", 10), Brushes.Black, 240, y + i * 25 + 20);
     }
     //domain.RechargeCardInfo cinfo = service.RechargeCardService.GetRechargeCardInfoByCardId(bInfo.cardId);
     e.Graphics.DrawString(string.Format("总金额:{0}元  账单号:{1}", bInfo.billMoney, bInfo.billKey), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 2) * 25);
     e.Graphics.DrawString(string.Format("折扣:{0}  折扣金额:{1} 元", bInfo.discount, bInfo.billMoney - bInfo.SHmoney), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 3) * 25);
     e.Graphics.DrawString(string.Format("应收金额:{0}元 结帐方式:{1} ", bInfo.SHmoney, bInfo.paymethod), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 4) * 25);
     //e.Graphics.DrawString(string.Format("结帐方式:{0}元 ", bInfo.paymethod), new Font("Arial", 10), Brushes.Black, 10, 50 + (bInfo.detailInfos.Count + 5) * 25);
     if (type == 1)
     {
         //e.Graphics.DrawString(string.Format("易享卡卡号:{0}", bInfo.vipNo), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 5) * 25);
         //e.Graphics.DrawString(string.Format("充值卡号:{0} 充值卡余额:{1}元", bInfo.cardId, cinfo == null ? "0.0" : (cinfo.Balance + cinfo.FHBalance).ToString()), new Font("Arial", 10), Brushes.Black, 10, 50 + (bInfo.detailInfos.Count + 6) * 25);
         e.Graphics.DrawString(string.Format("实收金额:{0}元,找零{1}元", bInfo.SHmoney, bInfo.zl), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 5) * 25);
         e.Graphics.DrawString(string.Format("结账时间:{0}", bInfo.checktime), new Font("Arial", 10), Brushes.Black, 10, 50 + (detailInfos.Count + 6) * 25);
     }
 }
开发者ID:JimDeng,项目名称:WenJiaPC,代码行数:34,代码来源:CheckoutPrinter.cs


示例9: OnPrintPage

        protected override void OnPrintPage(PrintPageEventArgs ev)
        {
            base.OnPrintPage(ev);

            ev.Graphics.PageUnit = GraphicsUnit.Millimeter;
            Font font; // = new Font(new FontFamily("Arial"), 7.0f, GraphicsUnit.Millimeter);

            Rectangle bodyRect = new Rectangle(3, 3, 184, 272);             // DVD Cover size 272x184
            Rectangle middleRect = new Rectangle(3, 129 + 3, 184, 14);      // DVD Covert side size, 14x184

            // Draw dotted rectable
            Pen borderPen = new Pen(System.Drawing.Color.Black, 0.3f);
            borderPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
            borderPen.DashPattern = new float[] {0.3F, 45F};
            ev.Graphics.DrawRectangle(borderPen, bodyRect);

            // Draw dotted rectable in middle
            //ev.Graphics.DrawRectangle(borderPen, middleRect);

            // Draw small "L" markers on cut positions
            Pen linePen = new Pen(System.Drawing.Color.Black, 0.3f);
            ev.Graphics.DrawLine(linePen, 3, 3, 6, 3);
            ev.Graphics.DrawLine(linePen, 3, 3, 3, 6);

            ev.Graphics.DrawLine(linePen, 184+3, 3, 181+3, 3);
            ev.Graphics.DrawLine(linePen, 184+3, 3, 184+3, 6);

            ev.Graphics.DrawLine(linePen, 3, 272+3, 6, 272+3);
            ev.Graphics.DrawLine(linePen, 3, 272+3, 3, 269+3);

            ev.Graphics.DrawLine(linePen, 184 + 3, 272 + 3, 181+3, 272 + 3);
            ev.Graphics.DrawLine(linePen, 184 + 3, 272 + 3, 184+3, 269 + 3);

            float startpos = middleRect.X + 2.0f;
            if (text1 != null)
            {
                font = new Font(new FontFamily("Arial"), size1, GraphicsUnit.Millimeter);
                startpos += DrawSideText(ev, font, 0, text1, startpos, middleRect.Y + ((middleRect.Height-size1) / 2.0f));
            }
            if (text2 != null)
            {
                font = new Font(new FontFamily("Arial"), size2, GraphicsUnit.Millimeter);
                startpos += DrawSideText(ev, font, 1, text2, startpos, middleRect.Y + ((middleRect.Height - size2) / 2.0f));
            }
            if (text3 != null)
            {
                font = new Font(new FontFamily("Arial"), size3, GraphicsUnit.Millimeter);
                startpos += DrawSideText(ev, font, 2, text3, startpos, middleRect.Y + ((middleRect.Height - size3) / 2.0f));
            }
            if (text4 != null)
            {
                font = new Font(new FontFamily("Arial"), size4, GraphicsUnit.Millimeter);
                startpos += DrawSideText(ev, font, 3, text4, startpos, middleRect.Y + ((middleRect.Height - size4) / 2.0f));
            }
            if (textnumber != null)
            {
                font = new Font(new FontFamily("Arial"), sizenumber, GraphicsUnit.Millimeter);
                startpos += DrawNumberText(ev, font, numbercolor, textnumber, middleRect.X + middleRect.Width - 2.0f, middleRect.Y + ((middleRect.Height - sizenumber) / 2.0f));
            }
        }
开发者ID:RangelReale,项目名称:DVDCoverPrinter,代码行数:60,代码来源:CoverPrint.cs


示例10: OnStartPage

        public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
        {
            Bitmap bmp = new Bitmap(1, 1);

            Graphics bmpg = Graphics.FromImage(bmp);
            IntPtr hdc = bmpg.GetHdc();
            ms = new MemoryStream();
            Metafile meta = new Metafile(ms, hdc, EmfType.EmfPlusDual);
            bmpg.ReleaseHdc(hdc);

            this.pic.Image = meta;

            Graphics g = Graphics.FromImage(meta);

            PaperSize size = e.PageSettings.PaperSize;
            int height = size.Height * dpi / 100;
            int width = size.Width * dpi / 100;

            if (e.PageSettings.Landscape)
            {
                g.FillRectangle(Brushes.White, 0, 0, height, width);
                g.SetClip(new Rectangle(0, 0, height - 16, width - 16));
            }
            else
            {
                g.FillRectangle(Brushes.White, 0, 0, width, height);
                g.SetClip(new Rectangle(0, 0, width - 16, height - 16));
            }

            return g;
        }
开发者ID:JosonYang,项目名称:aojreporter,代码行数:31,代码来源:AojPrintPreviewControl.cs


示例11: PrintDoc_PrintPage

        private void PrintDoc_PrintPage(object sender, PrintPageEventArgs e)
        {
            if (m_currentPrintSet == null)
            {
                m_currentPrintSet = new List<PictureViewBox>(m_pictureViewPanel.GetSelected());
                m_currentPrintSetItem = 0;
            }

            PictureViewBox pvb = m_currentPrintSet[m_currentPrintSetItem];
            Image image = pvb.Image;
            e.Graphics.DrawImage(image, 0, 0);
            image.Dispose();

            m_currentPrintSetItem++;

            if (m_currentPrintSetItem < m_currentPrintSet.Count)
            {
                e.HasMorePages = true;
            }
            else
            {
                m_currentPrintSetItem = 0;
                m_currentPrintSet = null;
                e.HasMorePages = false;
            }
        }
开发者ID:ewertons,项目名称:PhotoPrinter,代码行数:26,代码来源:Form1.cs


示例12: OnEndPage

 public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)
 {
     //if (ms != null)
     //{
     //    ms.Close();
     //}
 }
开发者ID:JosonYang,项目名称:aojreporter,代码行数:7,代码来源:AojPrintPreviewControl.cs


示例13: OnEndPage

 public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)
 {
     this.CheckSecurity();
     this.graphics.Dispose();
     this.graphics = null;
     base.OnEndPage(document, e);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PreviewPrintController.cs


示例14: pDoc_PrintPage

        void pDoc_PrintPage(object sender, PrintPageEventArgs e)
        {
            Graphics g = e.Graphics;
            int x = -110;
            int y = 30;
            int cell_height = 0;
            dGrid.ColumnHeadersVisible = true;
            int colCount = dGrid.ColumnCount;
            int rowCount = dGrid.RowCount;
            int current_col = 0;
            int current_row = 0;
            string value = "";
            Rectangle cell_border;
            SolidBrush brush = new SolidBrush(Color.Black);
            while (current_row < rowCount)
            {
                while (current_col < colCount)
                {
                    x += dGrid[current_col, current_row].Size.Width;
                    cell_height = dGrid[current_col, current_row].Size.Height;
                    cell_border = new Rectangle(x, y, dGrid[current_col, current_row].Size.Width, dGrid[current_col, current_row].Size.Height);
                    value = dGrid[current_col, current_row].Value.ToString();
                    g.DrawRectangle(new Pen(Color.Black), cell_border);
                    g.DrawString(value, new Font("tahoma", 6), brush, x, y);
                    current_col++;      //increment the currnet column
                }

                current_col = 0;
                current_row++;          //increment the current row
                x = -110;
                y += cell_height;
            }
        }
开发者ID:iMutex,项目名称:EBusiness,代码行数:33,代码来源:PrintReports.cs


示例15: CreateContext

 private PageContext CreateContext(PrintPageEventArgs document)
 {
     return new PageContext(document) {
         Horizontal = Horizontal,
         Lpi = (float) _lpi.Value,
     };
 }
开发者ID:atomicguy,项目名称:Lenticuprint,代码行数:7,代码来源:Form1.cs


示例16: OnPrintPage

        protected override void OnPrintPage(PrintPageEventArgs e)
        {
            if (_currentPage < _document.PageCount)
            {
                _document.Render(
                    _currentPage++,
                    e.Graphics,
                    e.PageSettings.PrinterResolution.X,
                    e.PageSettings.PrinterResolution.Y,
                    new Rectangle(
                        0,
                        0,
                        (int)((e.PageBounds.Width / 100.0) * e.PageSettings.PrinterResolution.X),
                        (int)((e.PageBounds.Height / 100.0) * e.PageSettings.PrinterResolution.Y)
                    )
                );
            }

            int pageCount =
                PrinterSettings.ToPage == 0
                ? _document.PageCount
                : Math.Min(PrinterSettings.ToPage, _document.PageCount);

            e.HasMorePages = _currentPage < pageCount;
        }
开发者ID:hongnba,项目名称:PdfViewer,代码行数:25,代码来源:PdfPrintDocument.cs


示例17: PreparePrinting

		private void PreparePrinting(PrintPageEventArgs ev)
		{
			#region Fonts
			_printFont = new Font("Times New Roman", 12,
				FontStyle.Regular);
			_printAllbergFont = new Font("Arial", 8, FontStyle.Regular);
			_printFontClubHeader = new Font("Times New Roman", 14, FontStyle.Bold);
			#endregion

			#region Margins
			_marginLeft = ev.PageSettings.HardMarginX;
			_marginTop = ev.PageSettings.HardMarginY;

			if (_marginLeft < 70)
				_marginLeft = 70;
			if (_marginTop < 20)
				_marginTop = 20;

			_marginRight = ev.PageSettings.Bounds.Width - _marginLeft;
			_marginBottom = ev.PageSettings.Bounds.Height - _marginTop - ev.Graphics.MeasureString("A", _printAllbergFont).Height;
			#endregion

			#region Columns
			_shooterColumnStart = _marginLeft;
			_payedColumnStart = _shooterColumnStart + ShooterColumnWidth;
			_arrivedColumnStart = _payedColumnStart + PayedColumnWidth;
			_numberOfRoundsColumnStart = _arrivedColumnStart + ArrivedColumnWidth;
			#endregion

			_useShouldHavePayed = _commonCode.CompetitionCurrent.UsePriceMoney;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:31,代码来源:CPrintFollowup.cs


示例18: OnPrintPage

		//Override the OnPrintPage to provide the printing logic for the document
		protected override void OnPrintPage(PrintPageEventArgs ev) 
		{
			_labelDocument.DocumentSizeXPixels = ev.PageBounds.Width;
			_labelDocument.DocumentSizeYPixels = ev.PageBounds.Height;

			for(;_currentCompetitor<_competitors.Length;_currentCompetitor++)
			{
				for(;_currentCompetitorSeries<_nrofseries;_currentCompetitorSeries++)
				{
					PrintLabel label;
					try
					{
						label = _labelDocument.GetLabel(_labelCount);
					}
					catch(PrintLabelDoesNotExistException)
					{
						_labelCount = 0;
						ev.HasMorePages = true;
						return;
					}
					PrintCompetitor(ev,_competitors[_currentCompetitor], _currentCompetitorSeries, label);
					_labelCount ++;
				}
				_currentCompetitorSeries = 0;
			}
			ev.HasMorePages = false;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:28,代码来源:CPrintMirrorLabels.cs


示例19: p_PrintPage

        private void p_PrintPage(object sender, PrintPageEventArgs ev)
        {
            float linesPerPage = 0;
            float yPos = 0;
            int count = 0;
            float leftMargin = ev.MarginBounds.Left;
            float topMargin = ev.MarginBounds.Top;
            string line = null;

            // Calculate the number of lines per page.
            linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics);

            // Print each line of the file.
            while (count < linesPerPage &&
               ((line = streamToPrint.ReadLine()) != null))
            {
                yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
                ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, new StringFormat());
                count++;
            }

            // If more lines exist, print another page.
            if (line != null)
                ev.HasMorePages = true;
            else
                ev.HasMorePages = false;
        }
开发者ID:alandias01,项目名称:Console_practice,代码行数:27,代码来源:Print.cs


示例20: pDoc_PrintPage

 private void pDoc_PrintPage(object sender, PrintPageEventArgs e)
 {
     m_Graphics = e.Graphics;
     PX = e.MarginBounds.Left *0.01f * 15.4f;
     PY = e.MarginBounds.Top * 0.01f * 15.4f;
     DrawPaper();
 }
开发者ID:hpbaotho,项目名称:top4ever-pos,代码行数:7,代码来源:DriverSinglePrint.cs



注:本文中的System.Drawing.Printing.PrintPageEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Printing.PrinterSettings类代码示例发布时间:2022-05-26
下一篇:
C# Printing.PrintEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap