From 4efd779d860d33a61bde470c6608d60b7b26e90c Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 27 Nov 2012 08:07:01 +0000 Subject: [PATCH] Added an animation for the zoom area, this is just to show what we could do... might not be the final effect. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2319 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/CaptureForm.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Greenshot/Forms/CaptureForm.cs b/Greenshot/Forms/CaptureForm.cs index a0099ca74..fc0547354 100644 --- a/Greenshot/Forms/CaptureForm.cs +++ b/Greenshot/Forms/CaptureForm.cs @@ -71,6 +71,8 @@ namespace Greenshot.Forms { private bool isZooming = true; private Point previousMousePos = Point.Empty; private FixMode fixMode = FixMode.None; + private Size zoomSize = new Size(20, 20); + private bool isAnimating = true; /// /// Property to access the selected capture rectangle @@ -329,7 +331,7 @@ namespace Greenshot.Forms { void updateFrame() { Point lastPos = cursorPos.Clone(); cursorPos = mouseMovePos.Clone(); - if (lastPos.Equals(cursorPos)) { + if (lastPos.Equals(cursorPos) && !isAnimating) { return; } @@ -444,8 +446,14 @@ namespace Greenshot.Forms { } } if (isZooming && captureMode != CaptureMode.Window) { - Invalidate(ZoomArea(lastPos, new Size(200, 200))); - Invalidate(ZoomArea(cursorPos, new Size(200, 200))); + Invalidate(ZoomArea(lastPos, zoomSize)); + if (zoomSize.Width < 200) { + zoomSize.Width += 10; + zoomSize.Height += 10; + } else { + isAnimating = false; + } + Invalidate(ZoomArea(cursorPos, zoomSize)); } // Force update "now" Update(); @@ -671,7 +679,7 @@ namespace Greenshot.Forms { const int zoomSourceHeight = 25; Rectangle sourceRectangle = new Rectangle(cursorPosOnBitmap.X - (zoomSourceWidth / 2), cursorPosOnBitmap.Y - (zoomSourceHeight / 2), zoomSourceWidth, zoomSourceHeight); - DrawZoom(graphics, sourceRectangle, ZoomArea(cursorPos, new Size(200, 200))); + DrawZoom(graphics, sourceRectangle, ZoomArea(cursorPos, zoomSize)); } }