/// <summary> /// Draws the extents for each allocation layer /// </summary> /// <param name="e">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param> private void DrawExtents(PaintEventArgs e) { pageExtentRenderer.ResizeExtentBrush(ExtentSize); for (var extent = windowPosition; extent < ExtentCount && extent < (VisibleExtents + windowPosition); extent++) { foreach (var layer in MapLayers) { if (layer.Visible && !layer.SingleSlotsOnly) { foreach (var chain in layer.Allocations) { var targetExtent = extent + (StartPage.PageId / 8); if (Allocation.CheckAllocationStatus(targetExtent, FileId, layer.Invert, chain)) { pageExtentRenderer.SetExtentBrushColour(layer.Colour, ExtentColour.BackgroundColour(layer.Colour)); pageExtentRenderer.DrawExtent(e.Graphics, ExtentPosition(extent - WindowPosition)); } } } } } }
internal static Bitmap KeyImage(Color color) { var key = new Bitmap(16, 16); var keyRectange = new Rectangle(0, 0, key.Width - 1, key.Height - 1); var g = Graphics.FromImage(key); var brush = new LinearGradientBrush(keyRectange, color, ExtentColour.BackgroundColour(color), LinearGradientMode.Horizontal); g.FillRectangle(brush, keyRectange); g.DrawRectangle(SystemPens.ControlDark, keyRectange); return(key); }