-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
BUGunexpected behaviorunexpected behavior
Description
This works:
formsPlot1.Plot.AddSignal(DataGen.Sin(51), label: "sin");
formsPlot1.Plot.AddSignal(DataGen.Cos(51), label: "cos");
formsPlot1.Render();
pictureBox1.Image = formsPlot1.Plot.RenderLegend();This throws an exception:
formsPlot1.Plot.AddSignal(DataGen.Sin(51));
formsPlot1.Plot.AddSignal(DataGen.Cos(51));
formsPlot1.Render();
pictureBox1.Image = formsPlot1.Plot.RenderLegend();System.ArgumentException
HResult=0x80070057
Message=Parameter is not valid.
Source=System.Drawing
StackTrace:
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at ScottPlot.Renderable.Legend.GetBitmap(Boolean lowQuality, Double scale) in C:\Users\scott\Documents\GitHub\ScottPlot\src\ScottPlot\Renderable\Legend.cs:line 68
at ScottPlot.Plot.RenderLegend(Boolean lowQuality, Double scale) in C:\Users\scott\Documents\GitHub\ScottPlot\src\ScottPlot\Plot\Plot.Render.cs:line 197
at WinFormsFrameworkApp.Form1..ctor() in C:\Users\scott\Documents\GitHub\ScottPlot\src\sandbox\WinFormsFrameworkApp\Form1.cs:line 18
at WinFormsFrameworkApp.Program.Main() in C:\Users\scott\Documents\GitHub\ScottPlot\src\sandbox\WinFormsFrameworkApp\Program.cs:line 19
| Bitmap bmp = new(width, height, PixelFormat.Format32bppPArgb); |
Fix this bug by returning a null if there are no items in the legend
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BUGunexpected behaviorunexpected behavior