示例#1
0
        public Encoder(int width, int height, int frameRate)
        {
            _myFrameEncodedCallback = MyFrameEncodedCallback;
            var result = Environment.Is64BitProcess ?
                         Interop64.CreateEncoder(out _encoderHandle, width, height, frameRate, _myFrameEncodedCallback) :
                         Interop32.CreateEncoder(out _encoderHandle, width, height, frameRate, _myFrameEncodedCallback);

            if (result != 0)
            {
                throw new PusherException(result);
            }
        }
示例#2
0
        public Encoder(int width, int height, int frameRate, int bitRate)
        {
            _myFrameEncodedCallback = MyFrameEncodedCallback;
            var result = Environment.Is64BitProcess ?
                         Interop64.CreateEncoder(out _encoderHandle, width, height, frameRate, bitRate, _myFrameEncodedCallback) :
                         Interop32.CreateEncoder(out _encoderHandle, width, height, frameRate, bitRate, _myFrameEncodedCallback);

            if (result != 0)
            {
                throw new PusherException(result);
            }
            _layerImage    = new Bitmap(width, height);
            _layerGraphics = Graphics.FromImage(_layerImage);
            _layerRect     = new Rectangle(0, 0, width, height);
            _layerDataSzie = width * height * 4;
        }