示例#1
0
        //Refresh displays
        private void refresh()
        {
            if (steps.count == 0)
            {
                remTC();
                return;
            }

            denom.Text = steps.count.ToString();
            num.Text   = indices.sIndex.ToString();

            ScaleBmp.setImg(StepPic, steps[indices.sIndex].image);      // Set current bitmap
            dispStep(steps[indices.sIndex].events.ToList());            // Set events (in a step)

            StepsList.SelectedIndex = indices.eIndex;                   // Highlight selected event

            //Enable or disable revert button
            if (steps.canUndo())
            {
                undoBut.Enabled = true;
            }
            else
            {
                undoBut.Enabled = false;
            }
        }
示例#2
0
        public static void setImg(PictureBox StepPic, Bitmap bmp)
        {
            if ((StepPic.Width | StepPic.Height) == 0)
            {
                return;
            }

            Action set = () =>
            {
                if (StepPic.Image != null)
                {
                    StepPic.Image.Dispose();
                }

                StepPic.Image = ScaleBmp.Scale(bmp, StepPic.Width, StepPic.Height);
            };

            StepPic.Invoke((Delegate)set);
        }
示例#3
0
 //Event handler for if the form is resized
 private void StepPic_SizeChanged(object sender, EventArgs e)
 {
     ScaleBmp.setImg(StepPic, steps[indices.sIndex].image);
 }