1

有关于格式大小和 pdf 打印屏幕位置的问题

第一部分是关于在尝试调整格式的大小时,其下方的编码不匹配或损坏。我已经为格式设置了中心屏幕和最大尺寸。谢谢。

下面是代码。样本。

    pictureBox1.Location = new Point(tbPages.Bounds.X , tbPages.Top + 30);
    pictureBox1.Size = new Size(tbPages.Width - 20, tbPages.Height / 2 - 50);
    richTextBox1.Location = new Point(pictureBox1.Bounds.X, pictureBox1.Bottom + 20);
    richTextBox1.Size = new Size(pictureBox1.Width, pictureBox1.Height);

尝试使用这种方式和中心屏幕。

结果是它没有相应地产生正确的输出。所以后来它就像我没有把位置点和大小一样。

屏幕截图。'已尝试使用位置进行格式化,但正如在窗口中看到的屏幕,它不会根据窗口中的 pdfsize 格式生成位图。它们的位置和大小都在一个屏幕区域中。

pdfcapture 屏幕应在 pdf 部分生成屏幕,以便捕获区域应与 pdf 区域大小匹配。如果您在看到带有捕获的 pdf 部分时知道这意味着什么。

位图现在位于 pdf 阅读器图像上方。

 btnCapture_Click(object sender, EventArgs e) { count_1++;
         User_Info ui = new User_Info();
         if (count_1 == 1)
         {
             pictureBox0.BringToFront();
             Bitmap bitmapForSS = new Bitmap(axAcroPDF1.Width, axAcroPDF1.Height );
             Graphics graphics = Graphics.FromImage(bitmapForSS as Image);
             graphics.CopyFromScreen(pictureBox0.Bounds.X, pictureBox0.Bounds.Y+35, 0, 0,bitmapForSS.Size);

        pictureBox0.Size = new Size(axAcroPDF1.Width + axAcroPDF1.Bounds.X, axAcroPDF1.Bounds.Height + axAcroPDF1.Bounds.Y);
        pictureBox0.Location = new Point(axAcroPDF1.Bounds.X, axAcroPDF1.Bounds.Y);
        pictureBox0.Image = bitmapForSS;
         ui.userPDFInven = ui.userPDFInven + "\\${count_1}";//ORIGIANLLY PUTTING THE ID
            MessageBox.Show("The count is ${count_1}");
           DirectoryInfo di = Directory.CreateDirectory(ui.userPDFInven);
          count1++;
      
    }
      //  pictureBox0.Image.Save("C:\\Users\\Thanks\\Documents\\PDFInven\\1.png", ImageFormat.Png);
      //  bitmapForSS.Save("C:\\Users\\Thanks\\Documents\\PDFInven\\1.jpeg", ImageFormat.Jpeg);

以上是最后的图片保存部分,但后来它不保存任何文件。

请在下方留言。

4

0 回答 0