diff --git a/Aaru.Gui/Controls/BlockMap.cs b/Aaru.Gui/Controls/BlockMap.cs index 80abe0b16..fd616d69e 100644 --- a/Aaru.Gui/Controls/BlockMap.cs +++ b/Aaru.Gui/Controls/BlockMap.cs @@ -438,6 +438,28 @@ namespace Aaru.Gui.Controls } } + void DrawSquares(Color[] colors, int borderWidth, int sideLength) + { + using IDrawingContextImpl ctxi = _bitmap.CreateDrawingContext(null); + using var ctx = new DrawingContext(ctxi, false); + + int squareWidth = (sideLength - (2 * borderWidth)) / colors.Length; + int squareHeight = squareWidth; + int x = 0; + int y = 0; + + foreach(Color color in colors) + { + ctx.FillRectangle(new SolidColorBrush(color), new Rect(x, y, squareWidth, squareHeight)); + x += squareWidth + (2 * borderWidth); + if(x >= sideLength) + { + x = 0; + y += squareHeight + (2 * borderWidth); + } + } + } + protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e) { if(Width < 1 ||