Looking for a specific article or video tutorial, maybe someone has already seen and I am losing time in search?

I'm talking about scissors from win7. Just a program that completely repeats the functionality. I want to understand.

  • 2
    What kind of scissors? - BubbleGum
  • Scissors - application in windows7. - Sergey

1 answer 1

It's easier to write it yourself. There is almost no functional there:

  1. You get a DC desktop.
  2. You put a picture on the created form without a title, stretched over the entire work area (although the scissors may act differently)
  3. You realize the choice of the area (for the Mouse Down event, the Mause Mov and Mouse Up). On the up, you take the selected area and place it in the form of a picture on the clipboard.
  • I have already implemented the first 2 points, but with the third problem. Yes, and the scissors have a bit more functionality; there is an opportunity to choose an arbitrary area and a window, although a rectangle is enough for me. On the other hand, I still want to understand how this was done. Just do not really understand how to make 2 windows. (where there is a desktop and the second as in scissors). - Sergey
  • Well, the third point, in fact, the main one. By MouseDown you get the origin coordinates. Using MouseMove, you memorize the trajectory of movement (if you need to get an arbitrary selection of a region or just draw a region with a rectangle so that you can see that you are going to copy it). For MouseUp, you get the second coordinate for the rectangle (or you close the area for a random selection of the area). After we have determined what we are going to copy (for example, the upper left corner and lower right for the rectangle, we copy this fragment of the picture to the clipboard. - pincher1519
  • Actually, you will have to implement the copying of the data from the image yourself (I don’t know if there are any ready-made copying of areas ...) you can go over the image, get a list of pixels that fall into the selected area and put them in a new image. Working with images is done through Bitmap and Image, as I think you already understood. Work with clipboard - Clipboard. Quite well work with them is described in a help. - pincher1519
  • What's the problem with the two windows? Form frm1 = new Form (); Form frm2 = new Form (); frm1.Show (); frm2.Show (); here are two windows ... Put them both on top of all windows. when you click on one of the windows, the second is hidden, as I understood in the scissors =) - pincher1519
  • I understand you need a second PictureBox for selection? To draw an arbitrary selection and a rectangle? - Sergey