Small fixes for the Zoom and its performance improvements

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2285 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-14 09:34:33 +00:00
commit 9ca5f0d3bd
3 changed files with 43 additions and 6 deletions

View file

@ -81,6 +81,17 @@ namespace Greenshot.Forms {
}
}
/// <summary>
/// This should prevent childs to draw backgrounds
/// </summary>
protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
public CaptureForm(ICapture capture, List<WindowDetails> windows) {
if (currentForm != null) {
LOG.Debug("Found currentForm, Closing already opened CaptureForm");
@ -105,6 +116,8 @@ namespace Greenshot.Forms {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
// Only double-buffer when we are not in a TerminalServerSession
this.DoubleBuffered = !System.Windows.Forms.SystemInformation.TerminalServerSession;
this.Text = "Greenshot capture form";
// Make sure we never capture the captureform
@ -367,7 +380,14 @@ namespace Greenshot.Forms {
}
}
}
/// <summary>
/// This makes sure there is no background painted, as we have complete "paint" control it doesn't make sense to do otherwise.
/// </summary>
/// <param name="pevent"></param>
protected override void OnPaintBackground(PaintEventArgs pevent) {
}
void OnPaint(object sender, PaintEventArgs e) {
Graphics graphics = e.Graphics;
Rectangle clipRectangle = e.ClipRectangle;