Example #1
0
        /// <summary>
        /// Gets called by projecstate on UI change: cursorindex.
        /// </summary>
        private void CursorIndexChanged()
        {
            if (framesContainer.Count == 0)
            {
                return;
            }

            //Set frame in container
            DiffusionCurves.Model.Frame frame = framesContainer.FramesList[this.framesContainer.CursorIndex];
            System.Drawing.Bitmap       bm    = null;

            if (frame.ImageUrl != null)
            {
                bm = new System.Drawing.Bitmap(frame.ImageUrl);
            }

            glHost.SetNewFrame(bm, frame.Curves);

            if (bm != null)
            {
                bm.Dispose();
            }

            //Next prev inactive
            if (this.framesContainer.Count == 0)
            {
                this.Prev.IsEnabled = false;
                this.Next.IsEnabled = false;
            }
            //Prev
            if (this.framesContainer.CursorIndex <= 0)
            {
                this.Prev.IsEnabled = false;
            }
            else
            {
                this.Prev.IsEnabled = true;
            }
            //Next
            if (this.framesContainer.CursorIndex == framesContainer.Count - 1)
            {
                this.Next.IsEnabled = false;
            }
            else
            {
                this.Next.IsEnabled = true;
            }
        }
Example #2
0
 /// <summary>
 /// Event for adding new frame.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewFrame_Click(object sender, RoutedEventArgs e)
 {
     DiffusionCurves.Model.Frame newframe = new DiffusionCurves.Model.Frame(null);
     this.framesContainer.AddFrame(newframe);
 }