Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jimin Park 2015-04-02 11:47:28 +09:00
commit 93b1bb2132
4 changed files with 50 additions and 55 deletions

View file

@ -101,15 +101,8 @@ public RectangleLight()
timer.Start();
}
private IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (timer != null) timer.Dispose();
if (backgroundImage != null) backgroundImage.Dispose();
if (backgroundBrush != null) backgroundBrush.Dispose();
@ -122,6 +115,7 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
SuspendLayout();
AutoScaleDimensions = new SizeF(6F, 13F);
AutoScaleMode = AutoScaleMode.Font;
StartPosition = FormStartPosition.Manual;
@ -160,28 +154,34 @@ private void RectangleLight_MouseDown(object sender, MouseEventArgs e)
positionOnClick = CaptureHelpers.GetCursorPosition();
isMouseDown = true;
}
else if (isMouseDown)
{
isMouseDown = false;
Refresh();
}
else
{
Close();
}
}
private void RectangleLight_MouseUp(object sender, MouseEventArgs e)
{
if (isMouseDown && e.Button == MouseButtons.Left)
if (e.Button == MouseButtons.Left)
{
if (SelectionRectangle0Based.Width > 0 && SelectionRectangle0Based.Height > 0)
if (isMouseDown)
{
LastSelectionRectangle0Based = SelectionRectangle0Based;
DialogResult = DialogResult.OK;
}
if (SelectionRectangle0Based.Width > 0 && SelectionRectangle0Based.Height > 0)
{
LastSelectionRectangle0Based = SelectionRectangle0Based;
DialogResult = DialogResult.OK;
}
Close();
Close();
}
}
else
{
if (isMouseDown)
{
isMouseDown = false;
Refresh();
}
else
{
Close();
}
}
}

View file

@ -70,8 +70,6 @@ public Point CurrentMousePosition0Based
public bool ShowRectangleInfo { get; set; }
public Image SelectionImage { get; private set; }
private Timer timer;
private Bitmap surface;
private Graphics gSurface;
@ -82,15 +80,6 @@ public Point CurrentMousePosition0Based
public RectangleTransparent()
{
StartPosition = FormStartPosition.Manual;
Bounds = ScreenRectangle;
Text = "ShareX - " + Resources.RectangleTransparent_RectangleTransparent_Rectangle_capture_transparent;
Shown += RectangleLight_Shown;
KeyUp += RectangleLight_KeyUp;
MouseDown += RectangleLight_MouseDown;
MouseUp += RectangleLight_MouseUp;
borderDotPen = new Pen(Color.Black, 1);
borderDotPen2 = new Pen(Color.White, 1);
borderDotPen2.DashPattern = new float[] { 5, 5 };
@ -102,6 +91,15 @@ public RectangleTransparent()
gSurface.SmoothingMode = SmoothingMode.HighSpeed;
gSurface.CompositingMode = CompositingMode.SourceCopy;
StartPosition = FormStartPosition.Manual;
Bounds = ScreenRectangle;
Text = "ShareX - " + Resources.RectangleTransparent_RectangleTransparent_Rectangle_capture_transparent;
Shown += RectangleLight_Shown;
KeyUp += RectangleLight_KeyUp;
MouseDown += RectangleLight_MouseDown;
MouseUp += RectangleLight_MouseUp;
using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
{
Cursor = new Cursor(cursorStream);
@ -154,8 +152,6 @@ private void RectangleLight_MouseUp(object sender, MouseEventArgs e)
if (SelectionRectangle0Based.Width > 0 && SelectionRectangle0Based.Height > 0)
{
LastSelectionRectangle0Based = SelectionRectangle0Based;
if (SelectionImage != null) SelectionImage.Dispose();
SelectionImage = GetAreaImage();
DialogResult = DialogResult.OK;
}
@ -167,7 +163,6 @@ private void RectangleLight_MouseUp(object sender, MouseEventArgs e)
if (isMouseDown)
{
isMouseDown = false;
Refresh();
}
else
{

View file

@ -160,7 +160,7 @@
</data>
<data name="lblX264CRF.Text" xml:space="preserve">
<value>CRF:</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lblX264CRF.Name" xml:space="preserve">
<value>lblX264CRF</value>
</data>
@ -294,10 +294,10 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
<value>Right</value>
</data>
<data name="tbVorbis_qscale.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 3</value>
<value>112, 3</value>
</data>
<data name="tbVorbis_qscale.Size" type="System.Drawing.Size, System.Drawing">
<value>229, 36</value>
<value>197, 36</value>
</data>
<data name="tbVorbis_qscale.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -321,10 +321,10 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
<value>Right</value>
</data>
<data name="tbMP3_qscale.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 3</value>
<value>112, 3</value>
</data>
<data name="tbMP3_qscale.Size" type="System.Drawing.Size, System.Drawing">
<value>229, 36</value>
<value>197, 36</value>
</data>
<data name="tbMP3_qscale.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -348,10 +348,10 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
<value>Right</value>
</data>
<data name="tbAACBitrate.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 3</value>
<value>112, 3</value>
</data>
<data name="tbAACBitrate.Size" type="System.Drawing.Size, System.Drawing">
<value>229, 36</value>
<value>197, 36</value>
</data>
<data name="tbAACBitrate.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -508,7 +508,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="btnFFmpegBrowse.Text" xml:space="preserve">
<value>...</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;btnFFmpegBrowse.Name" xml:space="preserve">
<value>btnFFmpegBrowse</value>
</data>
@ -553,7 +553,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="gbFFmpegExe.Text" xml:space="preserve">
<value>ffmpeg.exe</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;gbFFmpegExe.Name" xml:space="preserve">
<value>gbFFmpegExe</value>
</data>
@ -667,7 +667,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="btnFFmpegHelp.Text" xml:space="preserve">
<value>?</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;btnFFmpegHelp.Name" xml:space="preserve">
<value>btnFFmpegHelp</value>
</data>
@ -742,7 +742,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpX264.Text" xml:space="preserve">
<value>x264</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpX264.Name" xml:space="preserve">
<value>tpX264</value>
</data>
@ -769,7 +769,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="lblVpxCRF.Text" xml:space="preserve">
<value>CRF:</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lblVpxCRF.Name" xml:space="preserve">
<value>lblVpxCRF</value>
</data>
@ -793,7 +793,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpVpx.Text" xml:space="preserve">
<value>VP8</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpVpx.Name" xml:space="preserve">
<value>tpVpx</value>
</data>
@ -817,7 +817,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpXvid.Text" xml:space="preserve">
<value>Xvid</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpXvid.Name" xml:space="preserve">
<value>tpXvid</value>
</data>
@ -940,7 +940,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpAAC.Text" xml:space="preserve">
<value>AAC</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpAAC.Name" xml:space="preserve">
<value>tpAAC</value>
</data>
@ -994,7 +994,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpVorbis.Text" xml:space="preserve">
<value>Vorbis</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpVorbis.Name" xml:space="preserve">
<value>tpVorbis</value>
</data>
@ -1048,7 +1048,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
</data>
<data name="tpMP3.Text" xml:space="preserve">
<value>MP3</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;tpMP3.Name" xml:space="preserve">
<value>tpMP3</value>
</data>
@ -1383,7 +1383,7 @@ Similarly, for constant quality encoding, you will simply save bitrate by choosi
<value>eiFFmpeg</value>
</data>
<data name="&gt;&gt;eiFFmpeg.Type" xml:space="preserve">
<value>HelpersLib.ExportImportControl, HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;eiFFmpeg.Parent" xml:space="preserve">
<value>$this</value>

View file

@ -1913,7 +1913,7 @@ private void CaptureRectangleTransparent(TaskSettings taskSettings = null, bool
{
if (rectangleTransparent.ShowDialog() == DialogResult.OK)
{
img = rectangleTransparent.SelectionImage;
img = rectangleTransparent.GetAreaImage();
if (img != null)
{