private void AppbarFlashAuto_Click(object sender, RoutedEventArgs e)
 {
     if (this.mediaCapture != null && this.mediaCapture.VideoDeviceController.FlashControl.Supported)
     {
         FlashControl flashControl = this.mediaCapture.VideoDeviceController.FlashControl;
         if (flashControl.Auto)
         {
             flashControl.Auto    = false;
             flashControl.Enabled = true;
             var icon = new BitmapIcon();
             icon.UriSource            = new Uri("ms-appx:///Assets/appbar.camera.flash.png");
             this.AppbarFlashAuto.Icon = icon;
         }
         else if (flashControl.Enabled)
         {
             flashControl.Enabled = false;
             var icon = new BitmapIcon();
             icon.UriSource            = new Uri("ms-appx:///Assets/appbar.camera.flash.off.png");
             this.AppbarFlashAuto.Icon = icon;
         }
         else
         {
             flashControl.Auto    = true;
             flashControl.Enabled = true;
             var icon = new BitmapIcon();
             icon.UriSource            = new Uri("ms-appx:///Assets/appbar.camera.flash.auto.png");
             this.AppbarFlashAuto.Icon = icon;
         }
     }
 }
示例#2
0
        public override void CreateScene()
        {
            //create our hikarimanager
            _HikariManager            = new HikariManager("..\\..\\Media\\gui");
            viewport.BackgroundColour = new ColourValue(200, 200, 200);

            //creation of a flash control, first we create an overlay, then we load a flash control onto it
            _FpsControl = _HikariManager.CreateFlashOverlay("Fps", viewport, 130, 91, RelativePosition.TopLeft, 0, 0);
            _FpsControl.Load("fps.swf");
            _FpsControl.SetTransparent(true);

            _ColorPickerControl = _HikariManager.CreateFlashOverlay("ColorPicker", viewport, 350, 400, RelativePosition.Center, 1, 0);
            _ColorPickerControl.Load("controls.swf");
            _ColorPickerControl.SetTransparent(true, true);

            //define delegate of csharp functions that we can call from flash
            _AsyncExitCallback    = this.OnExitClick;
            _AsyncOpacityCallback = this.OnOpacityChange;
            _AsyncColorCallback   = this.OnColorChange;
            //bind it to our flash control
            _ColorPickerControl.Bind("opacityChange", _AsyncOpacityCallback);
            _ColorPickerControl.Bind("colorChange", _AsyncColorCallback);
            _ColorPickerControl.Bind("exitClick", _AsyncExitCallback);
        }
示例#3
0
        public override void CreateScene()
        {
            //create our hikarimanager
            _HikariManager = new HikariManager("..\\..\\Media\\gui");
            viewport.BackgroundColour = new ColourValue(200, 200, 200);

            //creation of a flash control, first we create an overlay, then we load a flash control onto it
            _FpsControl = _HikariManager.CreateFlashOverlay("Fps", viewport, 130, 91, RelativePosition.TopLeft, 0, 0);
            _FpsControl.Load("fps.swf");
            _FpsControl.SetTransparent(true);

            _ColorPickerControl = _HikariManager.CreateFlashOverlay("ColorPicker", viewport, 350, 400, RelativePosition.Center, 1, 0);
            _ColorPickerControl.Load("controls.swf");
            _ColorPickerControl.SetTransparent(true, true);

            //define delegate of csharp functions that we can call from flash
            _AsyncExitCallback = this.OnExitClick;
            _AsyncOpacityCallback = this.OnOpacityChange;
            _AsyncColorCallback = this.OnColorChange;
            //bind it to our flash control
            _ColorPickerControl.Bind("opacityChange", _AsyncOpacityCallback);
            _ColorPickerControl.Bind("colorChange", _AsyncColorCallback);
            _ColorPickerControl.Bind("exitClick", _AsyncExitCallback);
        }