0

I am creating a screen capture & crop utility using answer posted here The code draws a rectangle (System.Drawing.Rectangle) on the screen and saves a cropped image.

I need to make this rectangle movable to a different area on the screen without changing the size. How can I achieve this?

What did not work for me?

I tried this codeproject article, works very good to move controls on the screen. For this code to work correctly I would need to draw rectangle on a container control. Which container can be used to wrapping?

Being a succesful web developer I used to think that I can write for WinForms also... I was wrong :-( Some help would be much appreciated!

Community
  • 1
  • 1
Abhijeet
  • 13,562
  • 26
  • 94
  • 175

1 Answers1

0

In C# Windows Forms to change the location of a rectangle you do the following

rect.Location = new Location(x,y);

Where x and y are the coordinates (relative to the window's origin) that you want to move it to.

Here's a link to The MSDN Page on System.Drawing.Rectangle

Loothelion
  • 368
  • 1
  • 10