本文整理汇总了C#中ISurfaceHolder.SetFormat方法的典型用法代码示例。如果您正苦于以下问题:C# ISurfaceHolder.SetFormat方法的具体用法?C# ISurfaceHolder.SetFormat怎么用?C# ISurfaceHolder.SetFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISurfaceHolder
的用法示例。
在下文中一共展示了ISurfaceHolder.SetFormat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: OnStart
protected override void OnStart()
{
base.OnStart();
TesseractInit();
button.Enabled = true;
_boxPaint.Color = _boxWhite;
_boxPaint.SetStyle(Android.Graphics.Paint.Style.Stroke);
_boxPaint.StrokeWidth = 5;
_backgroundPaint.Color = Android.Graphics.Color.Black;
_backgroundPaint.Alpha = 255 / 2;
_backgroundPaint.SetStyle(Android.Graphics.Paint.Style.Fill);
_backgroundClearPaint.SetXfermode(new Android.Graphics.PorterDuffXfermode(Android.Graphics.PorterDuff.Mode.Clear));
_resizePaint.Alpha = 255 / 2;
_resizePaint.Color = _boxWhite;
_resizePaint.SetStyle(Android.Graphics.Paint.Style.Fill);
_resizePaint.StrokeWidth = 1;
_surfaceCamera = (SurfaceView)FindViewById(Resource.Id.surfaceCamera);
_holderCamera = _surfaceCamera.Holder;
_holderCamera.AddCallback(this);
_surfaceBox = (SurfaceView)FindViewById(Resource.Id.surfaceBox);
_surfaceBox.SetOnTouchListener(this);
_surfaceBox.SetWillNotDraw(false);
_holderBox = _surfaceBox.Holder;
_holderBox.AddCallback(this);
_holderBox.SetFormat(Android.Graphics.Format.Transparent);
_surfaceBox.SetZOrderOnTop(true);
_boxThread = new Thread(new ThreadStart(() =>
{
long lastUpdate = 0;
double fps = 60.0;
while (_cameraActive)
{
if (System.Environment.TickCount - lastUpdate > 1000 / fps)
{
lastUpdate = System.Environment.TickCount;
if (_box != null) {
DrawBox();
}
}
}
}));
bitmap = Android.Graphics.Bitmap.CreateBitmap(1, 1, Android.Graphics.Bitmap.Config.Argb8888);
bitmapWithBoxes = Android.Graphics.Bitmap.CreateBitmap(1, 1, Android.Graphics.Bitmap.Config.Argb8888);
for (int i = 0; i < threshholds.Length; i++)
{
threshholds[i] = 10 + i * 2;
}
_cameraActive = true;
_toast = Toast.MakeText(this, "", ToastLength.Short);
_processDialog = new Android.App.ProgressDialog(this);
_processDialog.Indeterminate = true;
_processDialog.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
_processDialog.SetTitle("Please wait");
_processDialog.SetMessage("Please wait...");
_processDialog.SetCancelable(true);
}