mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
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:
parent
a289a256fc
commit
1582b01e03
3 changed files with 13 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue