예제 #1
0
        /// <summary>
        /// Gets the default plot symbol size for all graphics in this graph, using the provided property context.
        /// </summary>
        /// <param name="context">The property context.</param>
        /// <returns>Default plot symbol size in points (1/72 inch).</returns>
        public static double GetDefaultSymbolSize(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
        {
            double result = 1;

            if (null != context)
            {
                var font = context.GetValue(PropertyKeyDefaultFont);
                using (var path = new System.Drawing.Drawing2D.GraphicsPath())
                {
                    path.AddString("x", Gdi.GdiFontManager.ToGdi(font.Font).FontFamily, (int)font.Style, (float)font.Size, new System.Drawing.PointF(0, 0), System.Drawing.StringFormat.GenericTypographic);
                    var bounds = path.GetBounds();

                    if (bounds.Height > 0)
                    {
                        result = Calc.Rounding.RoundToNumberOfSignificantDigits(bounds.Height, 2, MidpointRounding.ToEven);
                    }
                }
            }
            return(result);
        }
예제 #2
0
 public static NamedColor GetDefaultPlotColor(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
 {
     return(Altaxo.Graph.Gdi.GraphDocument.GetDefaultPlotColor(context));
 }