Results 1 to 3 of 3

Thread: Capture area of picturebox

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Capture area of picturebox

    Hi I have a picturebox that has other controls over it like labe and textbox and other image over it.

    But when I take capture of that area, and save it as .jpg it shows only white image and labels, text, image is not included.

    Here is my code for capture

    Code:
    Rectangle form = this.pictureBox1.Bounds;
                using (Bitmap bitmap = new Bitmap(form.Width, form.Height))
                {
                    using (Graphics graphic = Graphics.FromImage(bitmap))
                    {
                       pictureBox1.DrawToBitmap(bitmap, new Rectangle(0, 0, this.pictureBox1.Width, this.pictureBox1.Height));   
                    }
                    bitmap.Save("D://test.jpg", ImageFormat.Bmp);
                }
    What is the correct code to do that?
    Thanks,
    Last edited by dr_aybyd; Apr 14th, 2012 at 11:13 AM.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width