I like to write a screen capture utility. Plan : have a master control form, let it make a second transparant form on wich a selection rect can be drawn, copy the screen under the rectangle to a Bitmap with Grapics.CopyFromScreen.
Here is the essential code I have so far:
public partial class Master : Form
{
private Form Foil;
public Master()
{
InitializeComponent();
Foil = new TransparantFoil(this);
Foil.Hide();
}
private void Button_Click(object sender, EventArgs e)
{
this.Hide();
Foil.Show();
}
}
public partial class TransparantFoil : Form
{
private Form _master;
public TransparantFoil(Form M)
{
InitializeComponent();//WindowState= Maximized Opacity=0.4
_master = M;
}
private void TransparantFoil_Click(object sender, EventArgs e)
{
this.Hide();
_master.Show();
}
}
The only thing I wanted to do here is switching between the two forms, by clicking a button in Master and clicking on Transparant.
The problem is that Transparant sometimes thinks that the TaskBar is the main screen and I can't figure out why.
Anyone any suggestions? Is my basic strategy totally wrong?