Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from System.Drawing.Bitmap #779

Merged
merged 7 commits into from
Oct 23, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Oct 23, 2024

Resolves #522.

Checklist

Description

We use SixLabors.ImageSharp now in place of bitmaps, and in turn no project in the solution (other than the UI) is Windows-only.

TRImage continues to hide implementation details but ToImage() can be used to return an ImageSharp object if advanced editing is needed. The new wrapper drawing methods are not hugely efficient (convert to ImageSharp => draw => convert back) but these are only used in wireframing and in the room face export tool. They can maybe be further optimised in the future.

I've also split the TRImage class out to keep similar methods together for easier reference.

This removes the majority of Bitmap references, replacing with SixLabors.Image instead. This is only used internally in TRImage. The core library continues to use bitmaps for specific drawing techniques.
This moves the tests that were previously in ImageControl and LevelControl into a randomizer core specific test library.
WEBP, JPG and GIF now supported, if ever needed.
Replacement drawing methods are now provided in TRImage, courtesy of ImageSharp. This allows us to remove the final few bitmap references.
No projects have Windows-only dependencies now, bar the UI but that's a given.
This was Windows only too because it uses TRDataControl.
@lahm86 lahm86 added enhancement New feature or request internal labels Oct 23, 2024
@lahm86 lahm86 added this to the 1.10.0 milestone Oct 23, 2024
@lahm86 lahm86 self-assigned this Oct 23, 2024
@lahm86 lahm86 merged commit f656124 into LostArtefacts:master Oct 23, 2024
1 check passed
@lahm86 lahm86 deleted the issue-522-migrate-from-bitmap branch October 23, 2024 20:25
@lahm86 lahm86 mentioned this pull request Nov 5, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from System.Drawing.Bitmap
2 participants