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


C# ISurfaceHolder.AddCallback方法代码示例

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


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

示例1: MySurfaceView

        public MySurfaceView(Context context, IAttributeSet attr)
            : base(context, attr)
        {
            this.context = context;

            surfaceHolder = Holder;
            surfaceHolder.AddCallback(this);
        }
开发者ID:mojikashani,项目名称:Switch_Media,代码行数:8,代码来源:MySurfaceView.cs

示例2: 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

示例3: 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

示例4: CameraPreview

      public CameraPreview(Context context, Camera.IPreviewCallback previewCallback, bool cameraPreviewCallbackWithBuffer)
         : base(context)
      {
         _cameraPreviewCallbackWithBuffer = cameraPreviewCallbackWithBuffer;

         // Install a SurfaceHolder.Callback so we get notified when the
         // underlying surface is created and destroyed.
         _surfaceHolder = Holder;
         _surfaceHolder.AddCallback(this);

         _cameraPreviewCallback = previewCallback;
      }
开发者ID:reidblomquist,项目名称:emgucv,代码行数:12,代码来源:CameraPreview.cs

示例5: OnCreate

		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			if (!LibsChecker.CheckVitamioLibs (this))
				return;
			SetContentView (Resource.Layout.subtitle1);
			tv = (TextView)FindViewById (Resource.Id.sub1);
			splayer = (SurfaceView)FindViewById (Resource.Id.surface);
			sholder = splayer.Holder;
			sholder.SetFormat (Format.Rgba8888);
			sholder.AddCallback (this);
		}
开发者ID:shaxxx,项目名称:Xamarin.Vitamio,代码行数:12,代码来源:MediaPlayerSubtitle.cs

示例6: CameraPreview

		public CameraPreview (Context context)
			: base (context)
		{
			surfaceView = new SurfaceView (context);
			AddView (surfaceView);

			windowManager = Context.GetSystemService (Context.WindowService).JavaCast<IWindowManager> ();

			IsPreviewing = false;
			holder = surfaceView.Holder;
			holder.AddCallback (this);
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:12,代码来源:CameraPreview.cs

示例7: 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

示例8: OnCreate

		//    *
		//	 * 
		//	 * Called when the activity is first created.
		//	 
		protected override void OnCreate(Bundle icicle)
		{
			base.OnCreate(icicle);
			if (!LibsChecker.CheckVitamioLibs(this))
				return;
			SetContentView(Resource.Layout.mediaplayer_2);
			mPreview =  FindViewById<SurfaceView>(Resource.Id.surface);
			holder = mPreview.Holder;
			holder.AddCallback(this);
			holder.SetFormat(Format.Rgba8888);
			extras = Intent.Extras;

		}
开发者ID:huguodong,项目名称:VitamioBinding-1.0,代码行数:17,代码来源:MediaPlayerDemo_Video.cs

示例9: CameraPreview

        public CameraPreview(Context context, Camera camera,Camera.IPreviewCallback previewCallback) : base(context)
        {
            this.camera = camera;
            this.previewCallback = previewCallback;

            var parameters = this.camera.GetParameters();
            foreach (var p in from f in parameters.SupportedFocusModes where f == Camera.Parameters.FocusModeContinuousPicture select this.camera.GetParameters())
            {
                p.FocusMode = Camera.Parameters.FocusModeContinuousPicture;
                this.camera.SetParameters(p);
            }

            surfaceHolder = base.Holder;
            surfaceHolder.AddCallback(this);

        }
开发者ID:joacar,项目名称:MonoDroid.ZBar,代码行数:16,代码来源:CameraPreview.cs

示例10: CameraPreview

		public CameraPreview (Context context, Camera camera, Camera.CameraInfo cameraInfo, 
			SurfaceOrientation displayOrientation) :
			base (context)
		{
			// Do not initialize if no camera has been set
			if (camera == null || cameraInfo == null)
				return;
			
			this.camera = camera;
			this.cameraInfo = cameraInfo;
			this.displayOrientation = displayOrientation;

			// Install a SurfaceHolder.Callback so we get notified when the
			// underlying surface is created and destroyed.
			holder = Holder;
			holder.AddCallback (this);
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:17,代码来源:CameraPreview.cs

示例11: 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

示例12: 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

示例13: Panel

 public Panel(Context context) : base(context)
 {
     holder = Holder;
     holder.AddCallback(this);
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:5,代码来源:Panel.cs

示例14: 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

示例15: 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


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