Exemplo n.º 1
0
        System.Timers.Timer tmBar; // = new System.Timers.Timer();
        #endregion
        public void polosa(int t, Point pn, GeneralForm fsv, string txt = "")
        {
            workForm = fsv;
            //resolution = Screen.FromControl(fsv).WorkingArea.Size;
            //resolution = fsv.ClientSize;

            InitBar(t, pn, txt);
        }
Exemplo n.º 2
0
 public void StavkaGoPlus(GeneralForm ff)
 {
     //Graphics g = ff.CreateGraphics();
     //g.DrawString("<<< 600", new Font("times new roman", 30), Brushes.Yellow, NewPoint(500, 500));
     //Bitmap ekran = new Bitmap(Properties.Resources.GreenTable, resolution);
     //Bitmap bmpPolosa = new Bitmap(200, 50);
     //Point pn = new Point(500, 400);
     //Size sz = new Size(200, 50);
     //bmpPolosa = ekran.Clone(new RectangleF(pn, sz), System.Drawing.Imaging.PixelFormat.Format32bppArgb);
     //Graphics g1 = Graphics.FromImage(bmpPolosa);
 }
Exemplo n.º 3
0
        public void StartRul(int cel, Rectangle rc, GeneralForm fsv, int waitSecondOnEnd = 0)
        {
            this.Visible         = false;
            this.rc              = rc;
            flagStop             = false;
            tickNumber           = 0;
            this.fsv             = fsv;
            this.waitSecondOnEnd = waitSecondOnEnd;

            flag = false;

            #region//описание свойств формы
            DoubleBuffered = true;
            #endregion
            //vi = 0.04f;
            //vi += 0.00004f + 0.00008f;
            //i = 0.157080f+0.07854f;      //6.28319 количество радиан в 360 градусах
            //40 ячеек 9 градусов на ячейку, 1 градус - 0.0174533 радиана
            //1 ячейка - 0.15708 радиана 1/2 ячейки = 0.07854
            //стартовая позиция 11,5 ячеек = 1.80642 радиана
            // удленнение пути на 1 ячейку равно корень из 2а(S+n*0.15708)
            //2*pi/37 - количество радиан в 1 ячейке
            // vi = (float)Math.Sqrt(0.00004f * (37 + (14 + cel) * 0.15708f));
            this.Location = rc.Location;
            this.Parent   = fsv;
            this.enabled  = true;

            try
            {
                video = new Video(Application.StartupPath + String.Format("\\Video\\{0}.mp4", cel + 1), false);
                //size = video.Size;
                //this.Size = size;
                video.Owner = this;
                this.Size   = rc.Size;
                double koeff = 1.33; // (double)Width / (double)Height;
                size = new Size((int)(this.Height * koeff), this.Height);
                //this.Size = rc.Size;
                video.Size    = size;
                video.Ending += Video_Ending;
                this.Visible  = true;
                this.BringToFront();
                this.Refresh();
                video.Play();
            }
            catch
            {
                WaitBeforeStopRul();
                //MessageBox.Show("Ошибка загрузки видео!\n" + Marshal.GetLastWin32Error());
            }
        }
Exemplo n.º 4
0
        //Form fsv;
        #endregion

        public void Ikon(GeneralForm ff, int ikon) //анимация номера айкона и начало
        {
            #region                                //описание полй вывода
            workForm              = ff;
            this.ikon             = ikon;
            pictureBox1.Dock      = DockStyle.Fill;
            pictureBox1.BackColor = Color.Transparent;
            pictureBox1.Paint    += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
            workForm.Controls.Add(pictureBox1);
            #endregion

            tmi     = new System.Timers.Timer(300);
            tikStep = 0;
            //tmi.Interval = 300;
            //tmi.Tick += new EventHandler(tmi_Tick);
            tmi.Elapsed  += tmi_Tick;
            tmi.AutoReset = true;
            tmi.Enabled   = true;
            //tmi.Start();
        }
Exemplo n.º 5
0
        public void inputStavki(int st1, int st2, int st3, int st4, GeneralForm fsv, int number)
        {
            //workForm = fsv;
            stav1       = st1;
            stav2       = st2;
            stav3       = st3;
            stav4       = st4;
            this.number = number;
            //ff = v;

            if (stav1 == 0)
            {
                onStShow?.Invoke();
                return;
            }

            // size_stack =  NewSize(240, 0).Width;//41
            // distance = NewSize(400, 0).Width /2;
            // pn = NewRelPoint(55, 43);//46,90
            if (st4 == 0 && st3 != 0)
            {
                itsStavka  = true;
                size_stack = NewSize(252, 0).Width;
                distance   = NewSize(400, 0).Width / 2;
                pn         = NewRelPoint(17, 123);
                border     = new PictureBox
                {
                    Location  = NewPoint(860, 310),
                    Size      = NewSize(800, 800),
                    Name      = "oneuse",
                    BackColor = Color.Transparent,
                    Image     = Properties.Resources.RAMKA,
                    SizeMode  = PictureBoxSizeMode.StretchImage,
                    Parent    = workForm,
                };
            }
            else
            {
                size_stack = NewSize(223, 0).Width;
                distance   = NewSize(400, 0).Width / 2;
                pn         = NewRelPoint(20, 70);
                border     = new PictureBox
                {
                    Location  = NewPoint(1500, 790),
                    Name      = "oneuse",
                    Size      = NewSize(945, 450),
                    BackColor = Color.Transparent,
                    Image     = Properties.Resources.RAMKA,
                    SizeMode  = PictureBoxSizeMode.StretchImage,
                    Parent    = workForm,
                };
            }

            st         = new stakan();
            st.onStop += stavka2;
            int anons = stav1 + stav2 + stav3; // + stav4;

            if (itsStavka)
            {
                anons = 1;
            }
            st.stak(stav1 / 25, pn, workForm, border, anons, number);
        }
Exemplo n.º 6
0
            public void stak(int st1, Point point, GeneralForm fsv, PictureBox border, int komanda, int number)
            {
                //audio = LoadAudio();
                this.komanda = komanda;
                this.fsv     = fsv;
                this.border  = border;
                workForm     = fsv;
                if (workForm.InvokeRequired)
                {
                    workForm.BeginInvoke((MethodInvoker) delegate
                    {
                        stak(st1, point, fsv, border, komanda, number);
                    });
                }
                else
                {
                    // pc.Size = (number == 0) ? NewSize(160, 500) : NewSize(160, 400);//было 500
                    pc.Location  = point;
                    pc.BackColor = Color.Transparent;
                    pc.SizeMode  = PictureBoxSizeMode.StretchImage;
                    // pc.BorderStyle = BorderStyle.Fixed3D;
                    pc.Parent = border;
                    // pc.Visible = false;
                    lb = new Label()
                    {
                        Parent    = border,
                        Location  = new Point(point.X + 20, point.Y - 60),
                        Size      = NewSize(150, 50) + new Size(40, 0),
                        Name      = "oneuse",
                        ForeColor = Color.Gold,
                        BackColor = Color.Transparent,
                        Font      = new Font("arial", 12),
                        TextAlign = ContentAlignment.TopCenter,
                    };
                    pc.BringToFront();
                    lb.BringToFront();
                    lbSt = new Label() //метка размера ставки
                    {
                        Parent    = border,
                        Location  = new Point(point.X + 20, point.Y - 30),
                        Size      = NewSize(150, 50) + new Size(40, 0),
                        Name      = "oneuse",
                        ForeColor = Color.Gold,
                        BackColor = Color.Transparent,
                        Font      = new Font("arial", 18),
                        TextAlign = ContentAlignment.TopCenter,
                    };
                    if (komanda != 0 && komanda < 4)
                    {
                        lb.Text = komanda + " стол";
                    }
                    if (komanda > 5)
                    {
                        lbSt.Visible = false;

                        lb.Text     = "Выигрыш команды:" + fsv.predUs.team[number - 1].name + " составил " + komanda + " айкэш";
                        this.number = number;
                        lb.Location = NewRelPoint(0, 410);
                        lb.Size     = new Size(700, 70);
                        lb.Font     = new Font("arial", 11);
                        if (fsv.predUs.team[this.number - 1].name == fsv.myTeam.name)
                        {
                            this.fsv.iQash1.Text = this.fsv.steck.team[this.fsv.iQash1.number].iQash.ToString() + " IQ";
                        }
                    }
                    //lb.BringToFront();
                    if (komanda == 0)
                    {
                        lbSt.Visible = false;
                    }
                    try
                    {
                        frameCount   = 0;
                        indexToPaint = 0;
                        //if (video != null)
                        {
                            video?.Stop();
                            video?.Dispose();
                        }
                        video = new Video(Application.StartupPath + String.Format("\\Video\\Chips\\st{0}.mp4", st1), false); //вместо st25 поставить st1
                                                                                                                             //size = video.Size;
                                                                                                                             //this.Size = size;
                        video.Owner = pc;
                        pc.Size     = (number == 0) ? NewSize(252, 580) : NewSize(223, 322);
                        video.Size  = pc.Size;
                        //video.Ending += Video_Ending;
                        pc.Visible = true;
                        pc.BringToFront();
                        pc.Refresh();
                        try
                        {
                            frameCount = video.Duration;
                        }
                        catch
                        {  }
                        //if (video != null)
                        video.Play();
                    }
                    catch (Exception ex)
                    {
                        //MessageBox.Show("Ошибка загрузки видео:" + Environment.NewLine + "st1 = " + st1 + Environment.NewLine + ex.StackTrace + Environment.NewLine + Marshal.GetLastWin32Error());
                    }

                    /*img = Properties.Resources._12_50int2;
                     * dimension = new FrameDimension(img.FrameDimensionsList[0]);
                     * frameCount = img.GetFrameCount(dimension);
                     * //arr = new Bitmap[frameCount];
                     * int[] frame = new int[] { 12, 24, 36, 47, 58, 69, 80, 90, 100, 110, 120, 130 };
                     *
                     * frameCount = frame[st1 - 1]; */
                    /*
                     * for (int i = 0; i < frameCount; i++)
                     * {
                     *  img.SelectActiveFrame(dimension, i);
                     *  var bit = new Bitmap(img);
                     *  arr[i] = bit;
                     * }
                     */
                    stavka         = st1;
                    timer.Interval = 15;
                    timer.Tick    += new EventHandler(timer_Tick);
                    //audio.Play();
                    timer.Start();
                }
            }