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

Have no FromGraphics on the version last version #20

Closed
dxh-sc opened this issue Sep 20, 2023 · 3 comments
Closed

Have no FromGraphics on the version last version #20

dxh-sc opened this issue Sep 20, 2023 · 3 comments

Comments

@dxh-sc
Copy link

dxh-sc commented Sep 20, 2023

I am using the version of 3.0.0, but after i update to last version 5.0.0, can't build the project now.
I see there have no "KeyBitmap.Create.FromGraphics" on the version 5.0.0.
So there have another method to instead of it?

@jskeet
Copy link

jskeet commented Mar 1, 2024

Looks like this was removed in the "big bang v4 preview" commit.

I believe all the relevant code was in KeyBitmapDrawingExtensions.cs.

If the intention was to remove GDI+ dependencies from OpenMacroBoard.SDK, I suspect it would be reasonably simple to build a separate extension package that basically contained that code (assuming licensing etc is okay).
Otherwise, I suspect the expectation is that folks will move to use ImageSharp (KeyBitmap.Create.FromImageSharpImage(...)) instead.

@wischi-chr
Copy link
Member

@dxh-sc Sorry it took me so long to respond.

With the switch to v5 I removed some dependencies which were typically "windows-only" and/or not .NET 5 compatible. Yesterday I released v6 and there is now a new package you can add (as @jskeet suggested) to bring back those methods.

https://www.nuget.org/packages/OpenMacroBoard.SDK.KeyBitmap.GDI

I originally even thought about moving the ImageSharp dependency into a separate package with v6, but that would probably lead to a pretty bad developer experience, because the "naked" OpenMacroBoard.SDK - without the ImageSharp dependency - would only be able to create very trivial KeyBitmaps like solid colors or from raw RGB data and not load typical image formats like PNGs, JPEGs, etc. Also some things like the ButtonPressEffectAdapter internally use ImageSharp to rescale images and I would also have to move those. The StreamDeckSharp library is also probably the main use-case for OpenMacroBoard.SDK which internally also needs ImageSharp, because the protocol of some StreamDeckDevices require JPEGs and I use ImageSharp to do the JPEG conversion.

Please let me know if that works for you and feel free to reopen the issue or create a new one.

@jskeet
Copy link

jskeet commented Mar 3, 2024

@wischi-chr: Woot! Glad I was thinking along reasonable lines :) With the new package, I'll have another go at upgrading. (I don't know of any reason I particularly need to upgrade - but being ready for if and when there's Stream Deck+ support would be good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants