/// <summary> /// Updates the preview display using the specified symbolizer /// </summary> /// <param name="symbolizer">The symbolizer displayed in the preview</param> public void UpdatePreview(IFeatureSymbolizer symbolizer) { if (symbolizer == null) { return; } _symbolizer = symbolizer; Graphics g = CreateGraphics(); Rectangle rect = new Rectangle(0, 0, this.Width, this.Height); if (symbolizer is PointSymbolizer) { DrawPointSymbolizer(symbolizer as PointSymbolizer, g, rect); } else if (symbolizer is LineSymbolizer) { DrawLineSymbolizer(symbolizer as LineSymbolizer, g, rect); } else if (symbolizer is PolygonSymbolizer) { DrawPolygonSymbolizer(symbolizer as PolygonSymbolizer, g, rect); } else { symbolizer.Draw(g, rect); } g.Dispose(); }
/// <summary> /// Updates the preview display using the specified symbolizer. /// </summary> /// <param name="symbolizer">The symbolizer displayed in the preview.</param> public void UpdatePreview(IFeatureSymbolizer symbolizer) { if (symbolizer == null) { return; } _symbolizer = symbolizer; using Graphics g = CreateGraphics(); Rectangle rect = new(0, 0, Width, Height); if (symbolizer is PointSymbolizer pointSymbolizer) { DrawPointSymbolizer(pointSymbolizer, g, rect); return; } if (symbolizer is LineSymbolizer lineSymbolizer) { DrawLineSymbolizer(lineSymbolizer, g, rect); return; } if (symbolizer is PolygonSymbolizer polygonSymbolizer) { DrawPolygonSymbolizer(polygonSymbolizer, g, rect); } else { symbolizer.Draw(g, rect); } }
/// <summary> /// Updates the preview display using the specified symbolizer /// </summary> /// <param name="symbolizer">The symbolizer displayed in the preview</param> public void UpdatePreview(IFeatureSymbolizer symbolizer) { if (symbolizer == null) return; _symbolizer = symbolizer; Graphics g = CreateGraphics(); Rectangle rect = new Rectangle(0, 0, this.Width, this.Height); if (symbolizer is PointSymbolizer) { DrawPointSymbolizer(symbolizer as PointSymbolizer, g, rect); } else if (symbolizer is LineSymbolizer) { DrawLineSymbolizer(symbolizer as LineSymbolizer, g, rect); } else if (symbolizer is PolygonSymbolizer) { DrawPolygonSymbolizer(symbolizer as PolygonSymbolizer, g, rect); } else { symbolizer.Draw(g, rect); } g.Dispose(); }
/// <summary> /// Controls what happens in the legend when this item is instructed to draw a symbol. /// </summary> /// <param name="g"></param> /// <param name="box"></param> public override void LegendSymbol_Painted(Graphics g, Rectangle box) { _featureSymbolizer.Draw(g, box); }