Exemple #1
0
        public void RenderFrame(Rect dirtyRect, IntPtr buffer, int width, int height)
        {
            if (!this.terminated)
            {
                try
                {
                    if (surfaceBuffer != null &&
                        (surfaceBuffer.Width != width || surfaceBuffer.Height != height))
                    {
                        surfaceBuffer.Dispose();
                        surfaceBuffer = null;
                    }

                    if (surfaceBuffer == null)
                    {
                        surfaceBuffer = new DIBitmap(width, height);
                    }

                    // TODO: DirtyRect に対応
                    surfaceBuffer.SetSurfaceData(buffer, (uint)(width * height * 4));

                    UpdateLayeredWindowBitmap();
                }
                catch
                {
                }
            }
        }
        public void ClearFrame()
        {
            if (!this.terminated)
            {
                if (surfaceBuffer != null)
                {
                    surfaceBuffer.Dispose();
                }

                surfaceBuffer = new DIBitmap(Width, Height);
                UpdateLayeredWindowBitmap();
            }
        }