iinf

iinf

  • NA
  • 19
  • 0

Continously update image on another form

Dec 27 2010 4:26 PM
Hi Friends, I am using following code for screen capture:

 Bitmap bitmaptodisplayzoom = new Bitmap(SelectionRectangle.Height, SelectionRectangle.Width);

                using (Graphics g = Graphics.FromImage(bitmaptodisplayzoom))
                {
                    //new Point(319, 64), new Point(419,214)
                    g.CopyFromScreen(SourcePoint, new Point(0, 0), new Size(SelectionRectangle.Width, SelectionRectangle.Height));
                }

new form2(bitmaptodisplayzoom);
form2.Show();


The image is generate successfully. But when I am passing it though the constructor to other form to display in picturebox, a box with red cross is shown on that form. Also please guide me how to continusly send screen captured image to display on another form in picturebox with the mouse move. The error which it is throiwng is "parameter not valid" and when I tried

bitmaptodisplayzoom.save("test.jpg");

 it saves the first image successfully but after that gives generic gdi+ error. Please help

Answers (5)