Skip to content

Plot: Add image launching capabilities #2543

@swharden

Description

@swharden

Frequently I save a png in a console app then want to view it. It's not always trial to locate where the image was saved if it uses relative file paths and the app is launched from various folders. If I'm actively coding and regenerating the PNG, the default image viewer doesn't refresh automatically. I typically have to load the PNG in a browser to give me easy refresh. It may be worth making a flat-file HTML image viewer that uses javascript to auto-refresh the image every few seconds...

This logic should probably be isolated in its own class somewhere outside the Plot module.

I'm thinking usage like:

ScottPlot.Plot plt = new();
plt.SaveFig("test.png");

plt.Launch.ImageFile("test.png"); // launch the PNG using the system default file handler
plt.Launch.ImageFileViewer("test.png"); // writes test.png and test.png.html
plt.Launch.EmbeddedHtml("test.html"); // writes a single HTML file with embedded PNG data
plt.Launch.Interactive(); // launches the WinFormsViewer (Windows builds only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueThis 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!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions