Пример #1
0
        private void InitializeGraphics()
        {
            // get the size in both pixels and millimeters and use them to calibrate the unit converter
            // which will be used by other components when they need to convert units.
            Location size = MapToWorld(ClientRectangle.Width, ClientRectangle.Height);

            UnitsConverter.Calibrate(new Location(ClientRectangle.Width, ClientRectangle.Height), size);

            // create grid bitmap
            CreateGridBitmap();

            // create final bitmap
            _finalBitmap = new Bitmap(ClientRectangle.Width, ClientRectangle.Height, PixelFormat.Format32bppArgb);

            _liPoints.DrawingArea = _drawingArea;

            _currentPointClicked = PointF.Empty;
            _selectedPoint       = -1;

            // this line is necessary to prevent flicker
            if (!this.DesignMode)   // noticed that in design mode we need to erase background or
            // things will be overwritten and get messy!
            {
                SetStyle(ControlStyles.Opaque, true);
            }
        }
Пример #2
0
        private void InitializeGraphics()
        {
            // get the size in both pixels and millimeters and use them to calibrate the unit converter
            // which will be used by other components when they need to convert units.
            Location size = MapToWorld(ClientRectangle.Width, ClientRectangle.Height);

            UnitsConverter.Calibrate(new Location(ClientRectangle.Width, ClientRectangle.Height), size);

            // create grid bitmap
            CreateGridBitmap();

            // this line is necessary to prevent flicker
            if (!this.DesignMode)   // noticed that in design mode we need to erase background or
            // things will be overwritten and get messy!
            {
                SetStyle(ControlStyles.Opaque, true);
            }
        }