Exemplo n.º 1
0
 /// <summary>
 /// Updates the windows form that contains the image of the current content.
 /// </summary>
 /// <param name="cascade">If true, it will call UpdateDisplay on NextDisplay as well</param>
 /// <returns></returns>
 public bool UpdateDisplay(bool cascade)
 {
     if (content != null)
     {
         if (pictureBox != null)
         {
             // Preview, or mini-Live display
             pictureBox.Image = ShowBeam.DrawProportionalBitmap(pictureBox.Size, GetBitmap(this.Size)).Bitmap;
         }
         else if (imagepanel != null)
         {
             imagepanel.ImagePack = ShowBeam.DrawProportionalBitmap(imagepanel.Size, GetBitmap(this.Size));
         }
         else if (showBeam != null && showBeam.TopLevelControl.Visible)
         {
             // Live display
             showBeam.GDIDraw(this.GetBitmap(Size));
         }
     }
     if (cascade && NextDisplay != null)
     {
         return(NextDisplay.UpdateDisplay(cascade));
     }
     return(true);
 }
Exemplo n.º 2
0
        public GuiTools(MainForm impForm, ShowBeam impShowBeam) :  base(impForm, impShowBeam)
        {
            this.RightDock       = new RightDock(impForm, impShowBeam);
            this.Presentation    = new Presentation(impForm, impShowBeam);
            this.SandDockLayouts = new Hashtable();

            ReadSandDockLayouts();
        }
Exemplo n.º 3
0
        public Bitmap GetBitmap(int Width, int Height)
        {
            if (this.RenderedFramesContains(this.VisibleHashCode()))
            {
                Console.WriteLine("ImageContent pre-render cache hit.");
                return(this.RenderedFramesGet(this.VisibleHashCode()) as Bitmap);
            }

            Bitmap   bmp      = new Bitmap(Width, Height);
            Graphics graphics = Graphics.FromImage(bmp);

            #region Render background image
            // Draw background image
            if (this.HideBG == false)
            {
                string fullPath = DreamTools.GetFullPathOrNull(DreamTools.GetDirectory(DirType.DataRoot), this.BGImagePath);
                if (DreamTools.FileExists(fullPath))
                {
                    if (this.bgImage == null)
                    {
                        try {
                            this.bgImage = Image.FromFile(fullPath);
                        } catch { }
                    }
                }

                if (this.bgImage != null)
                {
                    if (this._proportional)
                    {
                        graphics.DrawImage(ShowBeam.DrawProportionalBitmap(new System.Drawing.Size(Width, Height), this.bgImage).Bitmap, 0, 0, Width, Height);
                    }
                    else
                    {
                        graphics.DrawImage(this.bgImage, 0, 0, Width, Height);
                    }
                }
            }
            else
            {
                // Draw blank rectangle if no image is defined
                graphics.FillRectangle(new SolidBrush(Color.Black), new Rectangle(0, 0, Width, Height));
            }
            #endregion

            graphics.Dispose();
            this.RenderedFramesSet(this.VisibleHashCode(), bmp);

            return(bmp);
        }
Exemplo n.º 4
0
 public BGImageTools(MainForm impForm, ShowBeam impShowBeam)
     : base(impForm, impShowBeam)
 {
 }
Exemplo n.º 5
0
 public void SetDestination(ShowBeam showBeam)
 {
     this.showBeam = showBeam;
 }
Exemplo n.º 6
0
 public MediaListTools(MainForm impForm, ShowBeam impShowBeam)
     : base(impForm, impShowBeam)
 {
     MediaList = _MainForm.MediaList;
 }
Exemplo n.º 7
0
 public RightDock(MainForm impForm, ShowBeam impShowBeam)
     : base(impForm, impShowBeam)
 {
     this.BGImageTools   = new BGImageTools(impForm, impShowBeam);
     this.MediaListTools = new MediaListTools(impForm, impShowBeam);
 }
Exemplo n.º 8
0
 public Presentation(MainForm impForm, ShowBeam impShowBeam)
     : base(impForm, impShowBeam)
 {
     MediaList = _MainForm.MediaList;
 }
Exemplo n.º 9
0
 public GuiTemplate(MainForm impForm, ShowBeam impShowBeam)
 {
     this._MainForm = impForm;
     this._ShowBeam = impShowBeam;
 }