BlackBerry.Screen.Window.AddBuffers C# (CSharp) Метод

AddBuffers() публичный Метод

public AddBuffers ( int count ) : void
count int
Результат void
        public void AddBuffers(int count)
        {
            if (screen_create_window_buffers (handle, count) != 0) {
                throw new Exception ("Unable to create buffers.");
            }
        }

Usage 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::AddBuffers