src/AircraftTrajectories/Models/Visualisation/LegendCreator.cs
/// <summary>
/// Draws boundary values on the legend and title
/// </summary>
/// <param name="bmp"></param>
/// <param name="gradient"></param>
Draws boundary values on the legend and title
Draws boundary values on the legend and title
public void DrawText(Bitmap bmp, Boolean gradient)
        {
            Graphics g = Graphics.FromImage(bmp);
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
            g.PixelOffsetMode = PixelOffsetMode.HighQuality;
            if (gradient)
            {
                RectangleF rectmin = new RectangleF(57, 300, 58, 50);
                RectangleF rectmax = new RectangleF(57, 5, 58, 50);
                RectangleF rect2 = new RectangleF(57, 71, 48, 50);
                RectangleF rect3 = new RectangleF(57, 148, 48, 50);
                RectangleF rect4 = new RectangleF(57, 224, 48, 50);
                g.DrawString(min.ToString(), new Font("Tahoma", 10), Brushes.White, rectmin);
                g.DrawString(max.ToString(), new Font("Tahoma", 10), Brushes.White, rectmax);
                int x1 = (int)(0.75 * (max - min) + min);
                int x2 = (int)(0.50 * (max - min) + min);
                int x3 = (int)(0.25 * (max - min) + min);
                g.DrawString(x1.ToString(), new Font("Tahoma", 10), Brushes.White, rect2);
                g.DrawString(x2.ToString(), new Font("Tahoma", 10), Brushes.White, rect3);
                g.DrawString(x3.ToString(), new Font("Tahoma", 10), Brushes.White, rect4);
            }
            else
            {
                RectangleF rectitle = new RectangleF(0, 0, 200, 100);
                g.DrawString("Noise Level (dB)", new Font("Tahoma", 12), Brushes.White, rectitle);
            }
            g.Flush();
        }
public void DrawText ( Bitmap bmp , Boolean gradient ) { Graphics g = Graphics . FromImage ( bmp ) ; g . SmoothingMode = SmoothingMode . AntiAlias ; g . InterpolationMode = InterpolationMode . HighQualityBicubic ; g . PixelOffsetMode = PixelOffsetMode . HighQuality ; if ( gradient ) { RectangleF rectmin = new RectangleF ( 57 , 300 , 58 , 50 ) ; RectangleF rectmax = new RectangleF ( 57 , 5 , 58 , 50 ) ; RectangleF rect2 = new RectangleF ( 57 , 71 , 48 , 50 ) ; RectangleF rect3 = new RectangleF ( 57 , 148 , 48 , 50 ) ; RectangleF rect4 = new RectangleF ( 57 , 224 , 48 , 50 ) ; g . DrawString ( min . ToString ( ) , new Font ( " " , 10 ) , Brushes . White , rectmin ) ; g . DrawString ( max . ToString ( ) , new Font ( " " , 10 ) , Brushes . White , rectmax ) ; int x1 = ( int ) ( 0.75 * ( max - min ) + min ) ; int x2 = ( int ) ( 0.50 * ( max - min ) + min ) ; int x3 = ( int ) ( 0.25 * ( max - min ) + min ) ; g . DrawString ( x1 . ToString ( ) , new Font ( " " , 10 ) , Brushes . White , rect2 ) ; g . DrawString ( x2 . ToString ( ) , new Font ( " " , 10 ) , Brushes . White , rect3 ) ; g . DrawString ( x3 . ToString ( ) , new Font ( " " , 10 ) , Brushes . White , rect4 ) ; } else { RectangleF rectitle = new RectangleF ( 0 , 0 , 200 , 100 ) ; g . DrawString ( " " , new Font ( " " , 12 ) , Brushes . White , rectitle ) ; } g . Flush ( ) ; }
Draws boundary values on the legend and title
Draws boundary values on the legend and title
bmp
Bitmap
None
gradient
Boolean
None