当前位置: 首页>>代码示例>>C#>>正文


C# ISurfaceHolder.SetType方法代码示例

本文整理汇总了C#中ISurfaceHolder.SetType方法的典型用法代码示例。如果您正苦于以下问题:C# ISurfaceHolder.SetType方法的具体用法?C# ISurfaceHolder.SetType怎么用?C# ISurfaceHolder.SetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISurfaceHolder的用法示例。


在下文中一共展示了ISurfaceHolder.SetType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CameraPreview

 /// <summary>
 /// Default ctor
 /// </summary>
 public CameraPreview(Context context, Camera camera)
     : base(context)
 {
     this.camera = camera;
     surfaceHolder = GetHolder();
     surfaceHolder.AddCallback(this);
     surfaceHolder.SetType(ISurfaceHolderConstants.SURFACE_TYPE_PUSH_BUFFERS);
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:11,代码来源:CameraPreview.cs

示例2: Preview

 public Preview(Context context)
     : base(context)
 {
     // Install a SurfaceHolder.Callback so we get notified when the
     // underlying surface is created and destroyed.
     surface_holder = Holder;
     surface_holder.AddCallback (this);
     surface_holder.SetType (SurfaceType.PushBuffers);
 }
开发者ID:4ndr01d,项目名称:monodroid-samples,代码行数:9,代码来源:CameraPreview.cs

示例3: videoRecord

        public videoRecord(SurfaceView surface, string filename = "")
        {
            if (filename == "")
                videoFilename = System.IO.Path.Combine (Android.OS.Environment.ExternalStorageDirectory.ToString (), "myLOLvideo.mp4");
            else
                videoFilename = filename;
            isPaused = false;

            context = surface.Context;
            holder = surface.Holder;
            holder.AddCallback (this);
            holder.SetType (Android.Views.SurfaceType.PushBuffers);
        }
开发者ID:chimpinano,项目名称:WowZapp-Android,代码行数:13,代码来源:videoRecord.cs

示例4: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Carega o layout "main" na view principal
			SetContentView (Resource.Layout.Main);

			// Pega o botão do recurso de layout e coloca um evento nele
			Button button = FindViewById<Button> (Resource.Id.button);

			vv = FindViewById<VideoView> (Resource.Id.video_view);
			pb = FindViewById<ProgressBar> (Resource.Id.progress_bar);
			MediaController mc = new MediaController(this);
			mp = new MediaPlayer ();

			pb.SetOnTouchListener (this);

			var uri = Android.Net.Uri.Parse ("http://3gpfind.com/vid/load/Movie%20Trailer/Predators(3gpfind.com).3gp");
			vv.SetOnPreparedListener (this);
			vv.SetVideoURI(uri);
			vv.SetMediaController(mc);
			mc.SetMediaPlayer(vv);
			mc.SetAnchorView(vv);

			button.Click += delegate {
				mc.Show();
				if (!ready)
				{
					holder = vv.Holder;
					holder.SetType (SurfaceType.PushBuffers);
					holder.AddCallback(this);
					mp.SetDataSource(this, uri);
					mp.SetOnPreparedListener(this);
					mp.Prepare();
					ready = true;
				}

				mp.Start();
//				vv.Start();

				Toast.MakeText (this, "Video Started", ToastLength.Short).Show ();
			};
		}
开发者ID:rogeriofabricio,项目名称:XamarinCursoCross,代码行数:43,代码来源:MainActivity.cs

示例5: OnCreate

		protected override void OnCreate(Bundle bundle) {
			base.OnCreate(bundle);

			// Set our view from the "main" layout resource
			SetContentView(Resource.Layout.Main);
			_SurfaceView = FindViewById<SurfaceView>(Resource.Id.SurfaceView);
			_SurfaceHolder = _SurfaceView.Holder;
			_SurfaceHolder.AddCallback(this);
			_SurfaceHolder.SetType(SurfaceType.PushBuffers);

			_FlashIcon = FindViewById<ImageView>(Resource.Id.FlashIcon);
			_FlashIcon.Click += (sender, args) => {
				if (FlashlightOnMode != GetCameraFlashMode()) {
					TurnFlashOn();
				}
				else {
					TurnFlashOff();
				}
			};
			TurnFlashOn();
		}
开发者ID:Vaikesh,项目名称:Flash-Torch_Xamarin.Android,代码行数:21,代码来源:FlashTorchActivity.cs

示例6: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.EditVideo);
            filename = base.Intent.GetStringExtra("filename");
            fps = base.Intent.GetIntExtra("fps", 12);
            timeUsed = base.Intent.GetIntExtra("duration", 20);

            #if DEBUG
            Console.WriteLine("filename = {0}, fps = {1}, duration = {2}s", filename, fps, timeUsed);
            #endif

            HorizontalScrollView hsvImages = FindViewById<HorizontalScrollView>(Resource.Id.hsvImages);
            HorizontalScrollView callouts = FindViewById<HorizontalScrollView>(Resource.Id.hsvCallouts);
            SurfaceView surface = FindViewById<SurfaceView>(Resource.Id.surfaceView1);
            context = callouts.Context;

            ImageButton returnBack = FindViewById<ImageButton>(Resource.Id.btnBack);
            returnBack.Tag = 0;
            ImageButton returnHome = FindViewById<ImageButton>(Resource.Id.btnHome);
            returnHome.Tag = 1;

            LinearLayout bottom = FindViewById<LinearLayout>(Resource.Id.bottomHolder);

            ImageButton[] btn = new ImageButton[2];
            btn [0] = returnBack;
            btn [1] = returnHome;

            ImageHelper.setupButtonsPosition(btn, bottom, context);

            createImages(hsvImages);

            returnBack.Click += delegate
            {
                Finish();
            };

            returnHome.Click += delegate
            {
                Intent i = new Intent(this, typeof(Main.HomeActivity));
                i.AddFlags(ActivityFlags.ClearTop);
                StartActivity(i);
            };

            mediaPlayer = new MediaPlayer();

            holder = surface.Holder;
            holder.AddCallback(this);
            holder.SetType(Android.Views.SurfaceType.PushBuffers);
        }
开发者ID:chimpinano,项目名称:WowZapp-Android,代码行数:50,代码来源:EditVideo.cs

示例7: bindTakePhotoElements

 protected void bindTakePhotoElements()
 {
     surfaceView = FindViewById<SurfaceView>(Resource.Id.ContactNewSurfaceView);
     surfaceHolder = surfaceView.Holder;
     surfaceHolder.AddCallback(this);
     surfaceHolder.SetType(SurfaceType.PushBuffers);
 }
开发者ID:Armoken,项目名称:Learning,代码行数:7,代码来源:NewContactTakePhotoScreen.cs

示例8: SurfaceChanged

        public void SurfaceChanged(ISurfaceHolder holder, Android.Graphics.Format format, int width, int height)
        {
            try
            {
                holder.SetType(SurfaceType.PushBuffers);

                // 縦横が入れ替わっている場合の対処
                if (width < height)
                {
                    var t = width;
                    width = height;
                    height = t;
                }

                if (originalHeight * originalWidth == 0)
                {
                    originalWidth = width;
                    originalHeight = height;
                }

                // カメラ設定の編集
                ApplyCammeraSettings();

            }
            catch (System.IO.IOException)
            {
            }
        }
开发者ID:butaman,项目名称:AutoSendPic,代码行数:28,代码来源:MainActivity.cs

示例9: Preview

        internal Preview(Context context)
            : base(context)
        {
            mSurfaceView = new SurfaceView (context);
            AddView (mSurfaceView);

            // Install a SurfaceHolder.Callback so we get notified when the
            // underlying surface is created and destroyed.
            mHolder = mSurfaceView.Holder;
            mHolder.AddCallback (this);
            mHolder.SetType (SurfaceType.PushBuffers);
        }
开发者ID:4ndr01d,项目名称:monodroid-samples,代码行数:12,代码来源:CameraFragment.cs

示例10: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.VideoMessage);
            SurfaceView surface = FindViewById<SurfaceView>(Resource.Id.surfaceView1);

            double surfaceSize = wowZapp.LaffOutOut.Singleton.ScreenYHeight * .66;

            ImageButton record = FindViewById<ImageButton>(Resource.Id.btnRecord);
            ImageButton stop = FindViewById<ImageButton>(Resource.Id.btnStop);
            ImageButton pause = FindViewById<ImageButton>(Resource.Id.btnPause);
            ImageButton play = FindViewById<ImageButton>(Resource.Id.btnPlay);
            ImageButton edit = FindViewById<ImageButton>(Resource.Id.btnEdit);
            recordTimer = new System.Timers.Timer();
            recordTimer.Interval = 1000;
            recordTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => timerElapsed(sender, e);
            mediaPlayer = new Android.Media.MediaPlayer();
            progress = FindViewById<ProgressBar>(Resource.Id.progressBar1);
            timeLeft = FindViewById<TextView>(Resource.Id.textTimeLeft);
            Context context = timeLeft.Context;
            timeString = context.Resources.GetString(Resource.String.videoSeconds);
            timeLeft.Text = timeRemain.ToString() + " " + timeString;

            //CamcorderProfile camProf = new CamcorderProfile();
            //fps = camProf.VideoFrameRate;
            camera = null;

            ImageButton returnBack = FindViewById<ImageButton>(Resource.Id.imgBack);
            returnBack.Tag = 0;
            ImageButton flipView = FindViewById<ImageButton>(Resource.Id.imageRotate);
            flipView.Tag = 1;
            ImageButton returnHome = FindViewById<ImageButton>(Resource.Id.imgHome);
            returnHome.Tag = 2;

            LinearLayout bottom = FindViewById<LinearLayout>(Resource.Id.bottomHolder);

            ImageButton[] btn = new ImageButton[3];
            btn [0] = returnBack;
            btn [2] = returnHome;
            btn [1] = flipView;

            ImageHelper.setupButtonsPosition(btn, bottom, context);

            record.Click += delegate
            {
                if (!recording && !playing)
                    startRecording();
            };

            stop.Click += delegate
            {
                if (recording)
                    stopRecording();
                if (playing)
                    stopPlaying();
            };

            play.Click += delegate
            {
                if (!recording)
                    startPlayback();
            };

            edit.Click += delegate
            {
                Intent i = new Intent(this, typeof(EditVideo));
                i.PutExtra("filename", System.IO.Path.Combine(Android.OS.Environment.ExternalStorageDirectory.ToString(),
                           "myvideooutputfile.mp4"));
                i.PutExtra("fps", fps);
                i.PutExtra("duration", counter);
                StartActivityForResult(i, EDIT);
            };

            returnBack.Click += delegate
            {
                Finish();
            };

            returnHome.Click += delegate
            {
                Intent i = new Intent(this, typeof(Main.HomeActivity));
                i.AddFlags(ActivityFlags.ClearTop);
                StartActivity(i);
            };

            holder = surface.Holder;
            holder.AddCallback(this);
            holder.SetType(Android.Views.SurfaceType.PushBuffers);
        }
开发者ID:chimpinano,项目名称:WowZapp-Android,代码行数:89,代码来源:VideoMessageActivity.cs

示例11: Preview

 public Preview(Context context)
     : base(context)
 {
     mSurfaceView = new SurfaceView (context);
     AddView (mSurfaceView);
     mHolder = mSurfaceView.Holder;
     mHolder.AddCallback (this);
     mHolder.SetType (SurfaceType.PushBuffers);
 }
开发者ID:ryanerdmann,项目名称:angora,代码行数:9,代码来源:CustomCameraActivity.cs


注:本文中的ISurfaceHolder.SetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。