[Bug]: "System.Drawing.dll" Argument exception thrown with KryptonTableLayoutPanel when scaling set to 150%
See original GitHub issueHi! There is a component in my software that cracks when Windows is scaled to other than 100%. Right now we are changing screens from 1080p to 4k and people are scaling and there are problems. I have
The exception is in a particular method of control KryptonTableLayoutPanel:
private void BackGroundPanel_Refreshed()
{
_bm = new Bitmap(_backGroundPanel.Width, _backGroundPanel.Height, PixelFormat.Format32bppRgb);
_backGroundPanel.DrawToBitmap(_bm,
new Rectangle(0, 0, _backGroundPanel.Width, _backGroundPanel.Height));
BackgroundImage = _bm;
}
This is part of the stacktrace of the exception thrown:
Fallo en NewPanelSeleccion: El parámetro no es válido.
en System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
en Krypton.Toolkit.KryptonTableLayoutPanel.BackGroundPanel_Refreshed()
en Krypton.Toolkit.KryptonTableLayoutPanel.SetToBehindTable()
en Krypton.Toolkit.KryptonTableLayoutPanel.OnSizeChanged(EventArgs e)
Itt goes on, but this is the important part. If I change the KryptonTableLayoutPanel for a Forms.TableLayoutPanel everything works fine.
I’m working with Nightlies 65.22.3.77-alpha. I don’t know if this is solved on newer versions because nightlies are on 70.XX and I’m stil on VS 2019. Probably will change to stable channel but right now I don’t want to change if it’s not needed.
Thank you!
P.D: Please correct my code, I’m still figuring out how the code brackets work Edit: Done
Issue Analytics
- State:
- Created a year ago
- Comments:10 (8 by maintainers)

Top Related StackOverflow Question
@Smurf-IV Sorry, thought that version 7X was not compatible with <NET 5. I update to the last nightly and the issue is gone.
Hi @NintendoPlayer
Support was ended for just .NET 5 in v70 ‘lite’ packages, but not the full packages, as it reached EOL back in May