示例#1
0
        ///<summary>Make the control just tall enough to fit the font and the lesser of the user defined width vs the actual width.</summary>
        public static Size GetDrawingSize(MapAreaDisplayLabelControl displayLabel, int pixelsPerFoot)
        {
            Size controlSize = MapAreaPanel.GetScreenSize(displayLabel.MapAreaItem.Width, displayLabel.MapAreaItem.Height, pixelsPerFoot);
            Size textSize    = TextRenderer.MeasureText(displayLabel.MapAreaItem.Description, displayLabel.Font);

            return(new Size(Math.Min(controlSize.Width, textSize.Width), textSize.Height));
        }
示例#2
0
        private PointF GetXYFromMenuLocation(object sender)
        {
            PointF xy = PointF.Empty;

            if (sender != null &&
                sender is ToolStripMenuItem &&
                ((ToolStripMenuItem)sender).Tag != null &&
                ((ToolStripMenuItem)sender).Tag is System.Drawing.Point)
            {
                xy = MapAreaPanel.ConvertScreenLocationToXY(((System.Drawing.Point)((ToolStripMenuItem)sender).Tag), mapAreaPanel.PixelsPerFoot);
            }
            return(xy);
        }