Open reflectronic opened 4 years ago
Tagging subscribers to this area: @safern, @tannergooding See info in area-owners.md if you want to be subscribed.
We have to decide on what our road map is for System.Drawing and what kind of changes we want to take in it. For new code, libraries like Imagesharp and SkiaSharp may be better choices.
What are your thoughts about why it is important to extend System.Drawing? Who would use this do you expect?
Also, we would want it to work on Unix: does libgdiplus support this?
One thing that System.Drawing has (which no other frameworks do) is very close integration with Winforms. Really, this isn't something important to me personally, but e.g. I originally proposed CachedBitmap when someone asked me online how they could utilize it to speed up their drawing performance. Of course, they linked me to the C++ documentation for it, and there wasn't a way to do that from C#.
I know that System.Drawing isn't .NET's finest work 😛 but these are somewhat low-effort changes. GDI+ was rev'd once; it likely won't be updated again. Most of the work on the .NET side is coming up with a decent API shape; wrapping the right APIs is trivial. I promise I'm not some weird GDI+ fan - it's just low-hanging fruit that can likely be briefly completed in one release and never touched again.
Also, we would want it to work on Unix: does libgdiplus support this?
Not at the moment. However, the same was true of CachedBitmap. I implemented that in libgdiplus, and if this is approved, I'll implement this as well.
Background
GDI+ 1.1 added support for retrieving a histogram of the colors present in a bitmap. A handful of formats can be specified, each of which uses at most four channels of data to return the desired histogram(s). For example, the
Gray
format converts the bitmap to a grayscale image and returns a single histogram based on those grayscale values. However, thePArgb
format uses all four channels to return a histogram for the alpha channel and the premultiplied red, green, and blue channels.This proposal is one of many to add missing GDI+ 1.1 functionality to
System.Drawing
.API Proposal
See the documentation for:
This requires changes to libgdiplus in order to support it on non-Windows platforms.