コード例 #1
0
        public VideoPage()
        {
            this.InitializeComponent();

            mediaElement.AutoPlay = true;
            SetMovieSource();

            var cmp = new CommentPresenter();

            cmp.Load("test.nicocomment");

            var canvast = new CanvasTarget(canvas)
            {
                Fps = textBlockFps
            };
            var videot = new VideoTarget(mediaElement);

            _timer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1.0 / 30)
            };
            _timer.Tick += (f, e) =>
            {
                cmp.Draw(canvast, videot);
            };
            _timer.Start();
        }
コード例 #2
0
ファイル: FloatingText.cs プロジェクト: i-e-b/Slick
        private void MergeButton_Click(object sender, EventArgs e)
        {
            if (CanvasTarget == null || textBox == null)
            {
                return;
            }

            using (var bmp = new Bitmap(textBox.Width, textBox.Height, PixelFormat.Format32bppPArgb))
            {
                textBox.DrawToBitmap(bmp, new Rectangle(0, 0, textBox.Width, textBox.Height));
                CanvasTarget.CrossLoadImage(SystemImage.ToRaw(bmp), Left + textBox.Left, Top + textBox.Top, textBox.Size);
            }
            Visible = false;
        }
コード例 #3
0
        //

        // ==========================================================================================================
        public MainWindow()
        {
            InitializeComponent();
            // Привязка визуальных компонентов в массиив:
            for (int i = 0; i < StateSize; i++)
            {
                Button btn_main = (Button)CanvasMain.FindName("btn_" + i);
                if (btn_main != null)
                {
                    buttons_main[i] = btn_main;
                    btn_main.Click += ButtonZ_Click;
                    btn_main.Tag    = i;
                }
                Button btn_target = (Button)CanvasTarget.FindName("btn_" + (i + 100));
                if (btn_target != null)
                {
                    buttons_target[i] = btn_target;
                    btn_target.Tag    = i;
                }
            }

            DrawState(state0);
            DrawTargetState(state_target);
        }