c# - element rectangle -
I'm trying to copy the status of a Form1.cs: Skrinrakrd CC: Skrinbitmap. cs: I'm getting a rectangle and then copying it from the screen, but such a Ap- pears that it is not working. If I tries the following code: Where This is what you'll get You can test this code by creating a new WinForms project, an PictureBox from the screen. My code looks like this:
_recorder = New ScreenRecord (); _recorderkStartRecording (Picture Box 1, Picture Box 1. Rankangletoskrin (new Rectangle ());
class Skrinrakord {private Skrinbitmap Skimmap ; public void Initialising (picture box camera, rectangle Rikt) {scBitmap = new Skrinbitmap (cAM, Rikt); Cam.Image = scBitmap.GetBitmap ();}}
class screenbitmap {personal image box camera box; personal rectangle camera location; abstract Vjnik Skrinbitmap (Piccrboks camera, rectangle Rikt) {camBox = cam; CamLocation = Rikt;} public bitmap GetBitmap () {bitmap Skrinbitmap = GetScreen (); return Skrinbitmap;} private bitmap GetScreen () {bitmap scBitmap = new Bitmap (cambox. Width, cambox.Height); graphics g = Grafikskfremimej (Skibetmap); G.CopyFromScreen (camLocation.X, camLocation.Y, 0, 0, new shapes (cambox.Width, cambox.Height)); return scBitmap;} }
g.CopyFromScreen (camLocation.X, 121, 0, 0, new shapes (cambox.Width, cambox.Height));
121 is a random number, it works (I get an image, the part I want but it works) , So y coordinate of the rectangle is wrong? Or I'm missing something ...
behind the PictureBox , with the opacity move, you can easily move it to your code:
// When you take ambiguity about capturing the screen and later restored it Do it Opacity = 0.0; Point first = pointtaskins (picture box 1. location); Bitmap bit = new bitmap (picture box 1. wide, picture box 1.high); Graphics G = Graphics. Frame Image (bit); G.CopyFromScreen (first.x, first .w, 0, 0, image box size); this. Convenience = 1.0; PictureBox1.Image = bit;
PictureBox , and the code Click the
button 's
click event handler.
Comments
Post a Comment