c# - How can I take a picture from screen? -
i want write program shows 1 pc's screen others... presentation systems. how can take picture current screen?
.net exposes functionality via screen (system.windows.forms) class.
     // surface focusing upon      rectangle rect = new rectangle();       // capture screens in windows      foreach (screen screen in screen.allscreens)      {         // increase rectangle accommodate bounds of screens         rect = rectangle.union(rect, screen.bounds);      }       // create new image store capture      bitmap bitmap = new bitmap(rect.width, rect.height, pixelformat.format32bppargb);       using (graphics g = graphics.fromimage(bitmap))      {         // use gdi+ copy contents of screen bitmap         g.copyfromscreen(rect.x, rect.y, 0, 0, rect.size, copypixeloperation.sourcecopy);      }       // bitmap has screen capture      
Comments
Post a Comment