Beispiel #1
0
        private void toolStripButtonPrint_Click(object sender, EventArgs e)
        {
            Report report = new Report();

            report.ReportPages.Capacity = 1;
            ReportPage        reportPage = new ReportPage();
            ReportPictureItem reportItem = new ReportPictureItem();

            reportItem.Picture      = CurrentImage;
            reportItem.OldImageSize = reportItem.Picture.Size;
            reportItem.Bounds       = new Rectangle(new Point(0, 0), reportItem.Picture.Size);
            reportPage.ReportItems.Add(reportItem);
            report.ReportPages.Add(reportPage);
            reportFrom = new ReportForm(report);
            reportFrom.Show();
        }
Beispiel #2
0
        private void CreateReportFrom()
        {
            Report report = new Report();

            report.ReportPages.Capacity = imageListView.Items.Count;
            for (int i = 0; i < imageListView.Items.Count; i++)
            {
                ReportPage        reportPage = new ReportPage();
                ReportPictureItem reportItem = new ReportPictureItem();
                string            fileName   = imageListView.Items[i].FileName;
                reportItem.Picture      = new Bitmap(fileName);
                reportItem.OldImageSize = reportItem.Picture.Size;
                reportItem.Bounds       = new Rectangle(new Point(0, 0), reportItem.Picture.Size);
                reportPage.ReportItems.Add(reportItem);
                report.ReportPages.Add(reportPage);
            }
            reportFrom = new ReportForm(report);
            reportFrom.ShowDialog();
        }
Beispiel #3
0
 private void CreateReportFrom()
 {
     if (imageListView.SelectedItems != null && imageListView.SelectedItems.Count == 0)
     {
         DialogResult result = MsgBox.Show(Properties.Resources.StrCannotPrintEmpty, Properties.Resources.StrWarning, MsgBox.Buttons.OK, MsgBox.Icon.Warning);
     }
     else
     {
         if (CanPrint())
         {
             if (imageListView.SelectedItems != null && imageListView.SelectedItems.Count > 0)
             {
                 Report report = new Report();
                 report.ReportPages.Capacity = imageListView.SelectedItems.Count;
                 for (int i = 0; i < imageListView.SelectedItems.Count; i++)
                 {
                     var fileExtension = Path.GetExtension(imageListView.SelectedItems[i].FileName);
                     if (fileExtension == ".png")
                     {
                         ReportPage        reportPage = new ReportPage();
                         ReportPictureItem reportItem = new ReportPictureItem();
                         string            fileName   = imageListView.SelectedItems[i].FileName;
                         reportItem.Picture      = new Bitmap(fileName);
                         reportItem.OldImageSize = reportItem.Picture.Size;
                         reportItem.Bounds       = new Rectangle(new Point(0, 0), reportItem.Picture.Size);
                         reportPage.ReportItems.Add(reportItem);
                         report.ReportPages.Add(reportPage);
                     }
                 }
                 reportFrom = new ReportForm(report);
                 reportFrom.ShowDialog();
             }
         }
         else
         {
             DialogResult result = MsgBox.Show(Properties.Resources.StrCannotPrint, Properties.Resources.StrWarning, MsgBox.Buttons.OK, MsgBox.Icon.Warning);
         }
     }
 }
Beispiel #4
0
 public ReportCtrlPicture(ReportPictureItem reportItem) : base(reportItem)
 {
     InitializeComponent();
     subCtrl       = new PictureBox();
     SubCtrl.Image = ScaleFitPage((Bitmap)PictureItem.Picture, ReportForm.PAGE_HEIGHT, ReportForm.PAGE_WIDTH);
 }