question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: "System.Drawing.dll" Argument exception thrown with KryptonTableLayoutPanel when scaling set to 150%

See original GitHub issue

Hi! 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:closed
  • Created a year ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
NintendoPlayercommented, Aug 3, 2022

@Smurf-IV Sorry, thought that version 7X was not compatible with <NET 5. I update to the last nightly and the issue is gone.

0reactions
Wagnerpcommented, Aug 4, 2022

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

WinForms program throwing System.ArgumentException in ...
An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll. Additional information: Parameter is not valid.
Read more >
System.ArgumentException in System.Drawing.dll (&quot; ...
I am using Aspose.pdf version 11.1.1.0 to create reports from my asp.net mvc website. The packet has a coversheet that is converted from ......
Read more >
System.Drawing.Common.dll is not allowed or missing
I'm running Unity 2020.2.2f1 and set my project to work with .NET 4.x (which in my case is .NET 4.7.1). After manually uninstalling ......
Read more >
System.ArgumentException In Application at ...
Hello. I'm stuck in a mysterious problem. After upgrade from 16.1 to 17.1, my application is raising an Unhandled Exception, and if I...
Read more >
System.Drawing.Common.dll is not added to Net Core ...
When processes that needs dll to run is called exception is thrown: "System.IO.FileNotFoundException: Could not load file or assembly 'System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found