Beispiel #1
0
        private void Initvideo()
        {
            _decoder = new VideoDecoder(10);
            _decoder.Open(Map.Video);
            var black = new Bitmap(Resources.BlackBase, _decoder.width, _decoder.height);

            using (var s = new MemoryStream())
            {
                black.Save(s, ImageFormat.Png);
                s.Seek(0, SeekOrigin.Begin);
                _black = Texture2D.FromFile(device, s);
            }
            _videoTexture = new Texture2D(device, _decoder.width, _decoder.height, 1, 0, SurfaceFormat.Bgr32);
            _videoScale   = Math.Min((float)_showRect.Width / _decoder.width, (float)_showRect.Height / _decoder.height);
            _videoCenter  = new Vector2((float)_decoder.width / 2, (float)_decoder.height / 2);
            _videoExist   = true;
        }
Beispiel #2
0
 private void Initvideo()
 {
     _decoder = new VideoDecoder(10);
     _decoder.Open(Map.Video);
     var black = new Bitmap(Resources.BlackBase, _decoder.width, _decoder.height);
     using (var s = new MemoryStream())
     {
         black.Save(s, ImageFormat.Png);
         s.Seek(0, SeekOrigin.Begin);
         _black = Texture2D.FromFile(device, s);
     }
     _videoTexture = new Texture2D(device, _decoder.width, _decoder.height, 1, 0, SurfaceFormat.Bgr32);
     _videoScale = Math.Min((float)_showRect.Width / _decoder.width, (float)_showRect.Height / _decoder.height);
     _videoCenter = new Vector2((float)_decoder.width / 2, (float)_decoder.height / 2);
     _videoExist = true;
 }
Beispiel #3
0
 public void initvideo()
 {
     decoder = new VideoDecoder(10);
     decoder.Open(Path.Combine(Map.Location, Map.Video));
     Bitmap black = new Bitmap(Properties.Resources.BlackBase, decoder.width, decoder.height);
     using (MemoryStream s = new MemoryStream())
     {
         black.Save(s, System.Drawing.Imaging.ImageFormat.Png);
         s.Seek(0, SeekOrigin.Begin);
         Black = Texture2D.FromFile(device, s);
     }
     VideoTexture = new Texture2D(device, decoder.width, decoder.height, 1, 0, SurfaceFormat.Bgr32);
     VideoScale = Math.Min((float)showRect.Width / decoder.width, (float)showRect.Height / decoder.height);
     VideoCenter = new Vector2(decoder.width / 2, (float)decoder.height / 2);
     videoexist = true;
 }