BlackBerry.Screen.Window.Render C# (CSharp) Method

Render() public method

public Render ( Buffer buffer ) : void
buffer Buffer
return void
        public void Render(Buffer buffer)
        {
            var dirty = new int[] { 0, 0, Width, Height };
            // Flushing.SCREEN_WAIT_IDLE bombs on the PlayBook, lets use 0 (undefined, but used in samples!) for now.
            if (screen_post_window (handle, buffer.handle, 1, dirty, Flushing.SCREEN_WAIT_IDLE) != 0) {
                throw new Exception ("Unable to render buffer to window!!");
            }
        }

Same methods

Window::Render ( Buffer buf, Rectangle rect, Flushing flush ) : void

Usage Example

Example #1
0
        public static void Main(string[] args)
        {
            using (var nav = new Navigator ())
            using (var ctx = new Context ())
            using (var win = new Window (ctx)) {
                win.Usage = Usage.SCREEN_USAGE_NATIVE;
                win.AddBuffers (2);
                var bufs = win.Buffers;
                var pic = bufs[0];
                var brush = bufs[1];

                pic.Fill (0xffff0000);
                brush.Fill (0xff000000);
                win.Render (pic);

                //nav.OnSwipeDown = () => Dialog.Alert ("#MonoBerry", "Another Event Loop", new Button ("Ack"));
                ctx.OnFingerTouch = (x,y) => {
                    pic.Blit (brush, 0, 0, 10, 10, Math.Max (x - 5, 0), Math.Max (y - 5, 0));
                    win.Render (pic);
                };
                ctx.OnFingerMove = ctx.OnFingerTouch;
                ctx.OnFingerRelease = ctx.OnFingerTouch;

                PlatformServices.Run ();
            }
        }
All Usage Examples Of BlackBerry.Screen.Window::Render