private void RenderTicksAndGridLines(PlotDimensions dims, Bitmap bmp, bool lowQuality, double[] visibleMajorTicks, double[] visibleMinorTicks) { using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality, false); if (MajorGridVisible) { AxisTicksRender.RenderGridLines(dims, gfx, visibleMajorTicks, MajorGridStyle, MajorGridColor, MajorGridWidth, Edge); } if (MinorGridVisible) { AxisTicksRender.RenderGridLines(dims, gfx, visibleMinorTicks, MinorGridStyle, MinorGridColor, MinorGridWidth, Edge); } if (MinorTickVisible) { float tickLength = TicksExtendOutward ? MinorTickLength : -MinorTickLength; AxisTicksRender.RenderTickMarks(dims, gfx, visibleMinorTicks, tickLength, MinorTickColor, Edge, PixelOffset); } if (MajorTickVisible) { float tickLength = MajorTickLength; if (RulerMode) { tickLength *= 4; } tickLength = TicksExtendOutward ? tickLength : -tickLength; AxisTicksRender.RenderTickMarks(dims, gfx, visibleMajorTicks, tickLength, MajorTickColor, Edge, PixelOffset); } }
// TODO: store the TickCollection in the Axis module, not in the Ticks module. public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false) { using (Graphics gfx = GDI.Graphics(bmp, dims, lowQuality, false)) { if (MajorTickVisible) { AxisTicksRender.RenderTickMarks(dims, gfx, TickCollection.tickPositionsMajor, RulerMode ? MajorTickLength * 4 : MajorTickLength, MajorTickColor, Edge, PixelOffset); } if (MajorTickVisible && TickLabelVisible) { AxisTicksRender.RenderTickLabels(dims, gfx, TickCollection, TickLabelFont, Edge, TickLabelRotation, RulerMode, PixelOffset, MajorTickLength, MinorTickLength); } if (MinorTickVisible) { AxisTicksRender.RenderTickMarks(dims, gfx, TickCollection.tickPositionsMinor, MinorTickLength, MinorTickColor, Edge, PixelOffset); } if (MajorGridVisible) { AxisTicksRender.RenderGridLines(dims, gfx, TickCollection.tickPositionsMajor, MajorGridStyle, MajorGridColor, MajorGridWidth, Edge); } if (MinorGridVisible) { AxisTicksRender.RenderGridLines(dims, gfx, TickCollection.tickPositionsMinor, MinorGridStyle, MinorGridColor, MinorGridWidth, Edge); } } }
private void RenderTickLabels(PlotDimensions dims, Bitmap bmp, bool lowQuality) { using Graphics gfx = GDI.Graphics(bmp, dims, lowQuality, false); if (TickLabelVisible) { AxisTicksRender.RenderTickLabels(dims, gfx, TickCollection, TickLabelFont, Edge, TickLabelRotation, RulerMode, PixelOffset, MajorTickLength, MinorTickLength); } }