Beispiel #1
0
        protected override void OnStart(AppHost host)
        {
            ImageBinder imgBinder = host.LoadImageAndBind("../Data/imgs/favorites32.png");

            for (int i = 0; i < 100; ++i)
            {
                //share 1 img binder with multiple img boxes
                var imgBox = new CustomWidgets.ImageBox(
                    imgBinder.Width,
                    imgBinder.Height);

                imgBox.ImageBinder = imgBinder;
                imgBox.SetLocation(i * 32, 20);
                imgBox.MouseDown += (s, e) =>
                {
                    //test start animation
                    int nsteps = 40;
                    UIPlatform.RegisterTimerTask(20, timer =>
                    {
                        imgBox.SetLocation(imgBox.Left, imgBox.Top + 10);
                        nsteps--;
                        if (nsteps <= 0)
                        {
                            timer.Remove();
                        }
                    });
                };
                host.AddChild(imgBox);
            }
        }
 public ImageLoadingQueueManager()
 {
     //TODO: review here****
     UIPlatform.RegisterTimerTask(50, TimImageLoadMonitor_Tick);
     //default img caching
     _imgCache = new ImageCacheSystem();
 }
        protected override void OnStartDemo(SampleViewport viewport)
        {
            ImageBinder imgBinder = viewport.GetImageBinder2("../../Data/imgs/favorites32.png");

            for (int i = 0; i < 100; ++i)
            {
                //share 1 img binder with multiple img boxes
                var imgBox = new CustomWidgets.ImageBox(
                    imgBinder.Image.Width,
                    imgBinder.Image.Height);

                imgBox.ImageBinder = imgBinder;
                imgBox.SetLocation(i * 32, 20);
                imgBox.MouseDown += (s, e) =>
                {
                    //test start animation
                    int nsteps = 40;
                    UIPlatform.RegisterTimerTask(20, timer =>
                    {
                        imgBox.SetLocation(imgBox.Left, imgBox.Top + 10);
                        nsteps--;
                        if (nsteps <= 0)
                        {
                            timer.Remove();
                        }
                    });
                };
                viewport.AddContent(imgBox);
            }
        }
Beispiel #4
0
 public ImageContentManager(UIPlatform platform)
 {
     //TODO: review here****
     UIPlatform.RegisterTimerTask(50, TimImageLoadMonitor_Tick);
 }