Skip to content

Commit d17090a

Browse files
committed
2.4.0.7 - Removed "Resolution Ratio" from Region since it might not work with some display setups (see ticket 97 on SourceForge).
1 parent c15d669 commit d17090a

File tree

7 files changed

+704
-794
lines changed

7 files changed

+704
-794
lines changed

help/help-5.rtf

Lines changed: 699 additions & 716 deletions
Large diffs are not rendered by default.

interface/main/FormMain-Regions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private void RunRegionCaptures()
175175
{
176176
if (region.Enable)
177177
{
178-
if (_screenCapture.GetScreenImages(source: -1, component: -1, captureMethod: 0, autoAdapt: false, region.X, region.Y, region.Width, region.Height, region.ResolutionRatio, region.Mouse, out Bitmap bitmap))
178+
if (_screenCapture.GetScreenImages(source: -1, component: -1, captureMethod: 1, autoAdapt: false, region.X, region.Y, region.Width, region.Height, resolutionRatio: 100, region.Mouse, out Bitmap bitmap))
179179
{
180180
if (!SaveScreenshot(bitmap, region))
181181
{

interface/main/FormMain-Screenshots.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ private Bitmap DoPreview(object tag)
12101210
{
12111211
Region region = (Region)tag;
12121212

1213-
returnedBitmap = _screenCapture.GetScreenBitmap(-1, -1, 1, region.X, region.Y, region.Width, region.Height, region.ResolutionRatio, region.Mouse);
1213+
returnedBitmap = _screenCapture.GetScreenBitmap(source: -1, component: -1, captureMethod: 1, region.X, region.Y, region.Width, region.Height, resolutionRatio: 100, region.Mouse);
12141214
}
12151215

12161216
return returnedBitmap;

interface/region/FormRegion.Designer.cs

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

interface/region/FormRegion.cs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ private void AddRegion()
206206
Width = (int)numericUpDownWidth.Value,
207207
Height = (int)numericUpDownHeight.Value,
208208
Enable = checkBoxEnable.Checked,
209-
Encrypt = checkBoxEncrypt.Checked,
210-
ResolutionRatio = (int)numericUpDownResolutionRatio.Value
209+
Encrypt = checkBoxEncrypt.Checked
211210
});
212211

213212
Okay();
@@ -250,7 +249,6 @@ private void ChangeRegion()
250249
RegionCollection.Get(RegionObject).Height = (int)numericUpDownHeight.Value;
251250
RegionCollection.Get(RegionObject).Enable = checkBoxEnable.Checked;
252251
RegionCollection.Get(RegionObject).Encrypt = checkBoxEncrypt.Checked;
253-
RegionCollection.Get(RegionObject).ResolutionRatio = (int)numericUpDownResolutionRatio.Value;
254252

255253
Okay();
256254
}
@@ -298,8 +296,7 @@ private bool InputChanged()
298296
RegionObject.Width != (int)numericUpDownWidth.Value ||
299297
RegionObject.Height != (int)numericUpDownHeight.Value ||
300298
RegionObject.Enable.Equals(checkBoxEnable.Checked) ||
301-
!RegionObject.Encrypt.Equals(checkBoxEncrypt.Checked) ||
302-
RegionObject.ResolutionRatio != (int)numericUpDownResolutionRatio.Value))
299+
!RegionObject.Encrypt.Equals(checkBoxEncrypt.Checked)))
303300
{
304301
return true;
305302
}
@@ -339,17 +336,6 @@ private void UpdatePreviewImage(ScreenCapture screenCapture)
339336
{
340337
try
341338
{
342-
// The mouse pointer gets really weird if we go under 100 resolution ratio
343-
// so disable the mouse checkbox control to indicate we can't show the mouse pointer.
344-
if (numericUpDownResolutionRatio.Value == 100)
345-
{
346-
checkBoxMouse.Enabled = true;
347-
}
348-
else
349-
{
350-
checkBoxMouse.Enabled = false;
351-
}
352-
353339
if (checkBoxEnable.Checked)
354340
{
355341
pictureBoxPreview.Image = screenCapture.GetScreenBitmap(
@@ -360,7 +346,7 @@ private void UpdatePreviewImage(ScreenCapture screenCapture)
360346
(int)numericUpDownY.Value,
361347
(int)numericUpDownWidth.Value,
362348
(int)numericUpDownHeight.Value,
363-
(int)numericUpDownResolutionRatio.Value,
349+
resolutionRatio: 100,
364350
checkBoxMouse.Checked
365351
);
366352

modules/regions/Region.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ public class Region
9292
/// </summary>
9393
public bool Encrypt { get; set; }
9494

95-
/// <summary>
96-
/// The resolution ratio of the bitmap. A lower value makes the bitmap more blurry.
97-
/// </summary>
98-
public int ResolutionRatio { get; set; }
99-
10095
/// <summary>
10196
/// The empty constructor of the region.
10297
/// </summary>

modules/regions/RegionCollection.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public class RegionCollection : CollectionTemplate<Region>
4747
private const string REGION_HEIGHT = "height";
4848
private const string REGION_ENABLE = "enable";
4949
private const string REGION_ENCRYPT = "encrypt";
50-
private const string REGION_RESOLUTION_RATIO = "resolution_ratio";
5150

5251
private readonly string REGION_XPATH;
5352

@@ -167,11 +166,6 @@ public bool LoadXmlFileAndAddRegions(ImageFormatCollection imageFormatCollection
167166
xReader.Read();
168167
region.Encrypt = Convert.ToBoolean(xReader.Value);
169168
break;
170-
171-
case REGION_RESOLUTION_RATIO:
172-
xReader.Read();
173-
region.ResolutionRatio = Convert.ToInt32(xReader.Value);
174-
break;
175169
}
176170
}
177171
}
@@ -187,7 +181,6 @@ public bool LoadXmlFileAndAddRegions(ImageFormatCollection imageFormatCollection
187181
Version v2182 = config.Settings.VersionManager.Versions.Get(Settings.CODENAME_CLARA, Settings.CODEVERSION_CLARA);
188182
Version v2300 = config.Settings.VersionManager.Versions.Get(Settings.CODENAME_BOOMBAYAH, Settings.CODEVERSION_BOOMBAYAH);
189183
Version v2338 = config.Settings.VersionManager.Versions.Get(Settings.CODENAME_BOOMBAYAH, "2.3.3.8");
190-
Version v2406 = config.Settings.VersionManager.Versions.Get(Settings.CODENAME_BLADE, "2.3.0.6");
191184
Version configVersion = config.Settings.VersionManager.Versions.Get(AppCodename, AppVersion);
192185

193186
if (v2182 != null && string.IsNullOrEmpty(AppCodename) && string.IsNullOrEmpty(AppVersion))
@@ -209,7 +202,6 @@ public bool LoadXmlFileAndAddRegions(ImageFormatCollection imageFormatCollection
209202
region.Mouse = true;
210203
region.Enable = true;
211204
region.Encrypt = false;
212-
region.ResolutionRatio = 100; // 2.4.0.7
213205
}
214206

215207
if (v2300 != null && configVersion != null && configVersion.VersionNumber < v2300.VersionNumber)
@@ -222,8 +214,6 @@ public bool LoadXmlFileAndAddRegions(ImageFormatCollection imageFormatCollection
222214

223215
// Introduced in 2.4.0.0
224216
region.Encrypt = false;
225-
226-
region.ResolutionRatio = 100; // 2.4.0.7
227217
}
228218

229219
if (v2338 != null && configVersion != null && configVersion.VersionNumber < v2338.VersionNumber)
@@ -237,13 +227,6 @@ public bool LoadXmlFileAndAddRegions(ImageFormatCollection imageFormatCollection
237227
region.Name = string.Empty;
238228
}
239229
}
240-
241-
if (v2406 != null && configVersion != null && configVersion.VersionNumber <= v2406.VersionNumber)
242-
{
243-
log.WriteDebugMessage("Blade 2.4.0.6 or older detected");
244-
245-
region.ResolutionRatio = 100;
246-
}
247230
}
248231

249232
if (!string.IsNullOrEmpty(region.Name))
@@ -341,7 +324,6 @@ public bool SaveToXmlFile(Settings settings, FileSystem fileSystem, Log log)
341324
xWriter.WriteElementString(REGION_WIDTH, region.Width.ToString());
342325
xWriter.WriteElementString(REGION_HEIGHT, region.Height.ToString());
343326
xWriter.WriteElementString(REGION_ENCRYPT, region.Encrypt.ToString());
344-
xWriter.WriteElementString(REGION_RESOLUTION_RATIO, region.ResolutionRatio.ToString());
345327

346328
xWriter.WriteEndElement();
347329
}

0 commit comments

Comments
 (0)