c# There are questions regarding format sizing and resizing

Viewed 48

There are questions regarding sizing of format and pdf printscreen location

The first part is about resizing when trying to resize the format with the coding below it's does not match or broken down. i've set center screen and max size for the format. thanks.

below is the code. sample.

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

trying using this way and with center screen.

Result is that it does not produce right output accordingly. So later it is just as ive not put the location point and size.

screencapture. 've tried formatting with a location but as see the screen in the window it does not produce the bitmap according to the pdfsize format in the window. location and size both of them in one screen area.

pdfcapture screen should produce the screen in pdf section so that the capture area should be match with the pdf area size. if you know what it means as you see the pdf section with the capture.

bitmap is now above the pdf reader image.

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

This above is the the finally the picture saving part but later it does not save any file.

Please leave comments below.

0 Answers
Related