BUG-1700: Fixed issue with capturing IE, somehow the background color couldn't be retrieved the second time... a try-catch in the IEContainer.cs solves this.

This commit is contained in:
RKrom 2014-11-18 21:42:21 +01:00
commit 1582b01e03
3 changed files with 13 additions and 10 deletions

View file

@ -330,11 +330,14 @@ namespace Greenshot.Helpers.IEInterop {
public Color BackgroundColor {
get {
if (document2.bgColor != null) {
string bgColorString = (string)document2.bgColor;
int rgbInt = Int32.Parse(bgColorString.Substring(1), NumberStyles.HexNumber);
Color bgColor = Color.FromArgb(rgbInt >> 16, (rgbInt >> 8) & 255, rgbInt & 255);
return bgColor;
try {
string bgColor = (string)document2.bgColor;
if (bgColor != null) {
int rgbInt = Int32.Parse(bgColor.Substring(1), NumberStyles.HexNumber);
return Color.FromArgb(rgbInt >> 16, (rgbInt >> 8) & 255, rgbInt & 255);
}
} catch (Exception ex) {
LOG.Error("Problem retrieving the background color: ", ex);
}
return Color.White;
}