-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
This is present
ScottPlot/src/ScottPlot5/ScottPlot5/Interfaces/IColormap.cs
Lines 23 to 38 in 2e2c9e3
| /// <summary> | |
| /// Create a 1 by 256 bitmap displaying all values of a heatmap | |
| /// </summary> | |
| public static SKBitmap GetSKBitmap(this IColormap colormap, bool vertical) | |
| { | |
| uint[] argbs = Enumerable.Range(0, 256) | |
| .Select(i => colormap.GetColor((vertical ? 255 - i : i) / 255f).ARGB) | |
| .ToArray(); | |
| int bmpWidth = vertical ? 1 : 256; | |
| int bmpHeight = !vertical ? 1 : 256; | |
| SKBitmap bmp = Drawing.BitmapFromArgbs(argbs, bmpWidth, bmpHeight); | |
| return bmp; | |
| } |
However it would be nice to have a similar method that returned a ScottPlot.Image
This may be as simple as a one-liner, because I think an Image can be constructed form a GetSKBitmap
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels