-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!
Description
Issue:
1.Run the code sample, ScottPlot 4.1.72, .NET Framework 4.8 Winforms
2. pan away, zoom out, etc
3. mouse middle clixck
4. result: the image is not in the center
ScottPlot Version:
ScottPlot 4.1.72, .NET Framework 4.8 Winforms
Code Sample:
namespace BitmapTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
double pixelSizeuM = 3.2;
Bitmap monaLisa = DataGen.SampleImage();
var displayImage = formsPlot.Plot.AddImage(monaLisa, 0, 0, anchor: Alignment.MiddleCenter);
displayImage.HeightInAxisUnits = monaLisa.Height * pixelSizeuM;
displayImage.WidthInAxisUnits = monaLisa.Width * pixelSizeuM;
double xRelative = displayImage.WidthInAxisUnits.Value / 2;
double yRelative = displayImage.HeightInAxisUnits.Value / 2;
//plot fix marker to show center
var crosshair = formsPlot.Plot.AddMarker(0, 0, MarkerShape.cross, size: 30, color: Color.Red);
crosshair.MarkerLineWidth = 2;
formsPlot.Plot.SetAxisLimits(xMin: -xRelative, xMax: xRelative, yMin: -yRelative, yMax: yRelative);
formsPlot.Plot.AxisScaleLock(true);
formsPlot.Refresh();
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!