/// <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); }
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(); }
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); }
public BGImageTools(MainForm impForm, ShowBeam impShowBeam) : base(impForm, impShowBeam) { }
public void SetDestination(ShowBeam showBeam) { this.showBeam = showBeam; }
public MediaListTools(MainForm impForm, ShowBeam impShowBeam) : base(impForm, impShowBeam) { MediaList = _MainForm.MediaList; }
public RightDock(MainForm impForm, ShowBeam impShowBeam) : base(impForm, impShowBeam) { this.BGImageTools = new BGImageTools(impForm, impShowBeam); this.MediaListTools = new MediaListTools(impForm, impShowBeam); }
public Presentation(MainForm impForm, ShowBeam impShowBeam) : base(impForm, impShowBeam) { MediaList = _MainForm.MediaList; }
public GuiTemplate(MainForm impForm, ShowBeam impShowBeam) { this._MainForm = impForm; this._ShowBeam = impShowBeam; }