private void SetResolutionCore() { if (isLoaded) { this.SuspendLayout(); buffer.Resize(Width, Height); var position = context.targetPosition; context.Dispose(); context = new LayeredContext(this.Handle, buffer); context.targetPosition = position; this.Render(); this.NativeWidth = this.Width; this.NativeHeight = this.Height; this.ResumeLayout(false); } }
protected override void CreateHandle() { base.CreateHandle(); this.FormBorderStyle = FormBorderStyle.None; winStyle = this.GetWindowStyle(); winExStyle = this.GetWindowExtendedStyle(); UpdateHitVisible(); // Init client size if (this.Width == -1) { this.Width = this.NativeWidth; } if (this.Height == -1) { this.Height = this.NativeHeight; } // Init buffer buffer = new LayeredBuffer( this.Width, this.Height, SKColorType.Bgra8888, SKAlphaType.Premul); context = new LayeredContext(this.Handle, buffer); context.targetPosition = this.Location.ToRawPoint(); // ready isLoaded = true; frameTime = DateTime.Now; }
public virtual void OnRender(LayeredContext context) { }