Exemple #1
0
        public frmNewOverlay(bool textOverlay)
        {
            InitializeComponent();

            UserControl ctrl = null;

            if (textOverlay)
            {
                ctrl = new ctrlTextOverlay();
            }
            else
            {
                ctrl = new ctrlImageOverlay();
            }

            ctrl.Dock = DockStyle.Fill;
            panel1.Controls.Add(ctrl);
        }
Exemple #2
0
        private void lstOverlays_SelectedIndexChanged(object sender, EventArgs e)
        {
            pnlCurrentOverlay.Controls.Clear();
            if (lstOverlays.SelectedItems.Count > 0)
            {
                Overlay overlay = lstOverlays.SelectedItems[0].Tag as Overlay;
                if (overlay is TextOverlay)
                {
                    ctrlTextOverlay ctrl = new ctrlTextOverlay(overlay as TextOverlay, lstOverlays.Items.IndexOf(lstOverlays.SelectedItems[0]), _capturer);
                    ctrl.Dock = DockStyle.Fill;

                    pnlCurrentOverlay.Controls.Add(ctrl);
                }
                else if (overlay is ImageOverlay)
                {
                    ctrlImageOverlay ctrl = new ctrlImageOverlay(overlay as ImageOverlay, lstOverlays.Items.IndexOf(lstOverlays.SelectedItems[0]), _capturer);
                    ctrl.Dock = DockStyle.Fill;

                    pnlCurrentOverlay.Controls.Add(ctrl);
                }
            }
        }