Skip to content

Commit

Permalink
Fix Bug Excpetion PixelFormat is DontCare
Browse files Browse the repository at this point in the history
  • Loading branch information
vsc55 committed Mar 17, 2018
1 parent 37f1973 commit eb9f3fc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/System.Windows.Forms.Ribbon/Component Classes/RibbonButton.cs
Expand Up @@ -736,18 +736,18 @@ internal virtual Rectangle OnGetImageBounds(RibbonElementSizeMode sMode, Rectang
}
else
{
if (SmallImage != null)
{
return new Rectangle(
Bounds.Left + Owner.ItemMargin.Left,
Bounds.Top + ((Bounds.Height - SmallImage.Height) / 2),
SmallImage.Width,
SmallImage.Height);
}
else
{
return new Rectangle(ContentBounds.Location, new Size(0, 0));
}
if (SmallImage != null)
{
if (SmallImage.PixelFormat != Drawing.Imaging.PixelFormat.DontCare )
{
return new Rectangle(
Bounds.Left + Owner.ItemMargin.Left,
Bounds.Top + ((Bounds.Height - SmallImage.Height) / 2),
SmallImage.Width,
SmallImage.Height);
}
}
return new Rectangle(ContentBounds.Location, new Size(0, 0));
}
}

Expand Down

0 comments on commit eb9f3fc

Please sign in to comment.