mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
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
This commit is contained in:
parent
4cb72219a5
commit
4efd779d86
1 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 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));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue