本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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 ();
};
}
示例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();
}
示例13: Panel
public Panel(Context context) : base(context)
{
holder = Holder;
holder.AddCallback(this);
}
示例14: bindTakePhotoElements
protected void bindTakePhotoElements()
{
surfaceView = FindViewById<SurfaceView>(Resource.Id.ContactNewSurfaceView);
surfaceHolder = surfaceView.Holder;
surfaceHolder.AddCallback(this);
surfaceHolder.SetType(SurfaceType.PushBuffers);
}
示例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);
}