/// <summary> /// 發生於版面重新配置 /// </summary> protected virtual void OnReLayout() { if (!IsLoadComplete) { return; } if (BufferImage != null) { BufferImage.Dispose(); } if (BufferGraphics != null) { BufferGraphics.Dispose(); } if (ThisGraphics != null) { ThisGraphics.Dispose(); } MainRectangle = ClientRectangle; BufferImage = new Bitmap(this.DisplayRectangle.Width, this.DisplayRectangle.Height); BufferGraphics = Graphics.FromImage(BufferImage); BufferGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; //BufferGraphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; //BufferGraphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; ThisGraphics = CreateGraphics(); }
/// <summary> /// 繪製畫面 /// </summary> protected void Drawing() { BufferGraphics.Clear(Color.White); OnBeforeDraw(BufferGraphics); EffectObjects.AllDoBeforeDraw(BufferGraphics); EffectObjects.AllDoBeforeDrawFloor(BufferGraphics); OnDrawFloor(BufferGraphics); EffectObjects.AllDoBeforeDrawObject(BufferGraphics); GameObjects.AllDrawSelf(BufferGraphics); OnBeforeDrawUI(BufferGraphics); EffectObjects.AllDoBeforeDrawUI(BufferGraphics); UIObjects.AllDrawSelf(BufferGraphics); OnAfterDrawUI(BufferGraphics); EffectObjects.AllDoAfterDraw(BufferGraphics); OnAfterDrawReset(BufferGraphics); OnAfterDraw(BufferGraphics); ThisGraphics.DrawImageUnscaled(BufferImage, 0, 0); }