Esempio n. 1
0
		// Constructor
		public MainPage()
		{
			InitializeComponent();
            m_camera = new Microsoft.Devices.PhotoCamera();
            viewfinderBrush.SetSource(m_camera);

			//Add some more elements to the panel besides the ones already added in XAML
			//AddHeadingDots(arPanel);

            XDocument loadedData = XDocument.Load("res/CountryList.xml");

            var data = from query in loadedData.Descendants("CountryDetails")
                       select new CountryItems
                       {
                           name = (string)query.Element("Country"),
                           lat = Convert.ToDouble((string)query.Element("Latitude")),
                           lon = Convert.ToDouble((string)query.Element("Longitude")),
                       };


            foreach (CountryItems country in data)
            {
                pointVirtual(arPanel, country.name, 53, -8, country.lat, country.lon );
            }


            
		}
Esempio n. 2
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            AccelerometerSensor = new Accelerometer();
            AccelerometerStartup();

            if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true))
            {
                viewfinderCanvas.Visibility = Visibility.Visible;
                var cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);

                viewfinderBrush.SetSource(cam);
            }
        }
Esempio n. 3
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            AccelerometerSensor = new Accelerometer();
            AccelerometerSensor.CurrentValueChanged += new EventHandler <SensorReadingEventArgs <AccelerometerReading> >(AccelerometerSensor_ReadingChanged);
            AccelerometerStartup();

            if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true))
            {
                viewfinderCanvas.Visibility = Visibility.Visible;
                var cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);

                viewfinderBrush.SetSource(cam);
            }
        }
Esempio n. 4
0
 public Survive()
 {
     InitializeComponent();
     recLife.Height = 300;
     //SimpleMosquito simpleMosquito00 = new SimpleMosquito();
        // simpleMosquito00.setCount();
     //simpleMosquito00.setlife();
        // simpleMosquito00.setTotal();
     //initial camera
     m_camera = new Microsoft.Devices.PhotoCamera();
     viewfinderBrush.SetSource(m_camera); // this function should using Microsoft.Devices
     background[0] = new ImageBrush();
     background[1] = new ImageBrush();
     background[0].ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"/Image/soundoff.png", UriKind.Relative));
     background[1].ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"/Image/soundon.png", UriKind.Relative));
     startGame();
 }
        private void InitializeCamera()
        {
            cameraInitializedEvent.Reset();

            // Initialize the default camera.
            this.camera = new Microsoft.Devices.PhotoCamera(this.cameraFacingDirection.ToCameraType());

            // Event is fired when the PhotoCamera object has been initialized
            this.camera.Initialized           += this.CameraInitialized;
            this.camera.CaptureImageAvailable += this.CameraOnCaptureImageAvailable;
            this.camera.CaptureCompleted      += this.CameraOnCaptureCompleted;

            // Set the VideoBrush source to the camera
            this.viewfinderBrush = new VideoBrush();
            this.viewfinderBrush.SetSource(this.camera);
            this.videoRectangle.Fill = this.viewfinderBrush;

            // Adjust mirroring according to camera type
            this.UpdateOrientation(PageOrientation.Portrait);
            if (this.camera.CameraType == CameraType.Primary)
            {
                this.viewfinderBrush.RelativeTransform = new CompositeTransform {
                    CenterX = 0.5, CenterY = 0.5, Rotation = 90
                };
            }
            else
            {
                this.viewfinderBrush.RelativeTransform = new CompositeTransform {
                    CenterX = 0.5, CenterY = 0.5, Rotation = 90, ScaleX = -1
                };
            }

            // initialize the shutter sound
            // Audio
            ////Stream stream = TitleContainer.OpenStream("shutter.wav");
            ////_cameraShutterSound = SoundEffect.FromStream(stream);

            this.EnableShutterKey = true;
        }
Esempio n. 6
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     AccelerometerSensor = new Accelerometer();
     AccelerometerSensor.CurrentValueChanged += new EventHandler <SensorReadingEventArgs <AccelerometerReading> >(AccelerometerSensor_ReadingChanged);
     AccelerometerStartup();
     if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true))
     {
         viewfinderCanvas.Visibility = Visibility.Visible;
         var cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
         if (Orientation == PageOrientation.PortraitUp || Orientation == PageOrientation.PortraitDown || Orientation == PageOrientation.Portrait)
         {
             // Rotate for LandscapeRight orientation.
             viewfinderBrush.RelativeTransform =
                 new CompositeTransform()
             {
                 CenterX = 0.5, CenterY = 0.5, Rotation = 90
             };
         }
         viewfinderBrush.SetSource(cam);
     }
 }
Esempio n. 7
0
        private bool hasFlashlight()
        {
            var cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);

            return(cam.IsFlashModeSupported(FlashMode.On));
        }
Esempio n. 8
0
 private void StartCamera()
 {
     m_camera = new Microsoft.Devices.PhotoCamera();
     viewfinderBrush.SetSource(m_camera);
 }
Esempio n. 9
0
 private bool hasFlashlight()
 {
     var cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
     return cam.IsFlashModeSupported(FlashMode.On);
 }