コード例 #1
0
ファイル: MainActivity.cs プロジェクト: takigava/Glass
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.activity_main);

			// Get our button from the layout resource,
			// and attach an event to it
			mBlurringView = (BlurringView) FindViewById(Resource.Id.blurring_view);
			View blurredView = FindViewById(Resource.Id.blurred_view);

			// Give the blurring view a reference to the blurred view.
			mBlurringView.setBlurredView(blurredView);

			mImageViews[0] = (ImageView) FindViewById(Resource.Id.image0);
			mImageViews[1] = (ImageView) FindViewById(Resource.Id.image1);
			mImageViews[2] = (ImageView) FindViewById(Resource.Id.image2);
			mImageViews[3] = (ImageView) FindViewById(Resource.Id.image3);
			mImageViews[4] = (ImageView) FindViewById(Resource.Id.image4);
			mImageViews[5] = (ImageView) FindViewById(Resource.Id.image5);
			mImageViews[6] = (ImageView) FindViewById(Resource.Id.image6);
			mImageViews[7] = (ImageView) FindViewById(Resource.Id.image7);
			mImageViews[8] = (ImageView) FindViewById(Resource.Id.image8);

			DisplayMetrics metrics = new DisplayMetrics();

			WindowManager.DefaultDisplay.GetMetrics(metrics);

			double inches = Math.Sqrt((metrics.WidthPixels * metrics.WidthPixels) + (metrics.HeightPixels * metrics.HeightPixels)) / metrics.Density;
		}