NesHd.Core.Output.Video.Devices.VideoGdi.VideoGdi C# (CSharp) Method

VideoGdi() public method

public VideoGdi ( TvFormat tvFormat, Control surface ) : System.Drawing
tvFormat TvFormat
surface System.Windows.Forms.Control
return System.Drawing
        public VideoGdi(TvFormat tvFormat, Control surface)
        {
            if (surface == null)
                return;
            Debug.WriteLine(this, "Initializeing GDI ...", DebugStatus.None);
            switch (tvFormat)
            {
                case TvFormat.Ntsc:
                    _scanlinesToCut = 8;
                    _scanlines = 224;
                    _bitmap = new Bitmap(256, 224);
                    break;
                case TvFormat.Pal:
                    _scanlinesToCut = 0;
                    _scanlines = 240;
                    _bitmap = new Bitmap(256, 240);
                    break;
            }
            _buffer = new int[256*_scanlines];
            _surface = surface;
            UpdateSize(0, 0, _surface.Width + 1, _surface.Height + 1);
            Debug.WriteLine(this, "Video device " + @"""" + "GDI" + @"""" + " Ok !!", DebugStatus.Cool);
        }