本文整理汇总了C#中System.Windows.Media.VideoBrush类的典型用法代码示例。如果您正苦于以下问题:C# VideoBrush类的具体用法?C# VideoBrush怎么用?C# VideoBrush使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VideoBrush类属于System.Windows.Media命名空间,在下文中一共展示了VideoBrush类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VideoService
public VideoService(
Rectangle viewFinder,
MediaElement player
)
{
// Initial State
_State = PlayState.Paused;
_CanRecord = false;
_Record = new SwitchableCommand(OnRecord);
_Play = new SwitchableCommand(OnPlay);
_Stop = new SwitchableCommand(OnPause);
_ViewFinder = viewFinder;
_Player = player;
_Player.MediaEnded += MediaEnded;
_CaptureSource = new CaptureSource();
_CaptureSource.CaptureFailed += CaptureFailed;
_FileSink = new FileSink();
_Brush = new VideoBrush();
_HasRecording = new BehaviorSubject<bool>(false);
}
开发者ID:SNSB,项目名称:DiversityMobile,代码行数:26,代码来源:VideoService.cs
示例2: OnNavigatedTo
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
// Delayed due to Camera init bug in WP71 SDK Beta 2
// See http://forums.create.msdn.com/forums/p/85830/516843.aspx
Dispatcher.BeginInvoke(() =>
{
// Initialize the webcam
photoCamera = new PhotoCamera();
photoCamera.Initialized += PhotoCameraInitialized;
CameraButtons.ShutterKeyHalfPressed += PhotoCameraButtonHalfPress;
isInitialized = false;
isDetecting = false;
// Fill the Viewport Rectangle with the VideoBrush
var vidBrush = new VideoBrush();
vidBrush.SetSource(photoCamera);
Viewport.Fill = vidBrush;
// Start timer
dispatcherTimer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(50)};
dispatcherTimer.Tick += (sender, e1) => Detect();
dispatcherTimer.Start();
});
}
开发者ID:amoldeshpande,项目名称:slartoolkit,代码行数:27,代码来源:MainPage.xaml.cs
示例3: Load
void Load()
{
if (CaptureDeviceConfiguration.AllowedDeviceAccess ||
CaptureDeviceConfiguration.RequestDeviceAccess())
{
var devices = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices();
foreach (var device in devices)
{
var videoItem = new VideoItem();
videoItem.Name = device.FriendlyName;
var source = new CaptureSource();
source.VideoCaptureDevice = device;
var videoBrush = new VideoBrush();
videoBrush.SetSource(source);
videoItem.Brush = videoBrush;
this.sources.Add(source);
this.sourceItems.Add(videoItem);
}
this.videoItems.ItemsSource = this.sourceItems;
this.StartAll();
}
}
开发者ID:kindohm,项目名称:silverlight-app-does-what,代码行数:25,代码来源:MainPage.xaml.cs
示例4: StartWebCam
public void StartWebCam()
{
_captureSource = new CaptureSource();
_captureSource.CaptureImageCompleted += new EventHandler<CaptureImageCompletedEventArgs>(_captureSource_CaptureImageCompleted);
_captureSource.VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
try
{
// Start capturing
if (_captureSource.State != CaptureState.Started)
{
// Create video brush and fill the WebcamVideo rectangle with it
var vidBrush = new VideoBrush();
vidBrush.Stretch = Stretch.Uniform;
vidBrush.SetSource(_captureSource);
WebcamVideo.Fill = vidBrush;
// Ask user for permission and start the capturing
if (CaptureDeviceConfiguration.RequestDeviceAccess())
{
_captureSource.Start();
}
}
}
catch (InvalidOperationException)
{
InfoTextBox.Text = "Web Cam already started - if not, I can't find it...";
}
catch (Exception)
{
InfoTextBox.Text = "Could not start web cam, do you have one?";
}
}
开发者ID:al-main,项目名称:CloudyBank,代码行数:33,代码来源:ImageTaker.xaml.cs
示例5: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/EjemploCaptureSource;component/MainPage.xaml", System.UriKind.Relative));
this.BrochaVideo = ((System.Windows.Media.VideoBrush)(this.FindName("BrochaVideo")));
}
开发者ID:ccasbre27,项目名称:CaptureSourceWP,代码行数:8,代码来源:MainPage.g.i.cs
示例6: Destructive
public void Destructive ()
{
VideoBrush vb = new VideoBrush ();
// from this instance we can change all default values
BrushTest.DestructiveRelativeTransform (vb);
BrushTest.DestructiveTransform (vb);
// but it's safe to execute since we revert the changes
}
开发者ID:dfr0,项目名称:moon,代码行数:8,代码来源:VideoBrushTest.cs
示例7: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/Ejemplo%20Leer%20C%C3%B3digo%20Barras;component/MainPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.VideoBrushBackground = ((System.Windows.Media.VideoBrush)(this.FindName("VideoBrushBackground")));
}
开发者ID:rwecho,项目名称:Windows-Phone-Samples,代码行数:9,代码来源:MainPage.g.cs
示例8: MainPage_Loaded
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
captureSource = new CaptureSource
{
VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice()
};
var videoBrush = new VideoBrush();
videoBrush.SetSource(captureSource);
Viewport.Fill = videoBrush;
markerDetector = new CaptureSourceMarkerDetector();
var marker = Marker.LoadFromResource("Bola.pat", 64, 64, 80);
markerDetector.Initialize(captureSource, 1d, 4000d, marker);
markerDetector.MarkersDetected += (obj, args) =>
{
Dispatcher.BeginInvoke(() =>
{
var results = args.DetectionResults;
if (results.HasResults)
{
var centerAtOrigin =
Matrix3DFactory.
CreateTranslation(
-Imagem.ActualWidth*
0.5,
-Imagem.
ActualHeight*
0.5, 0);
var scale =
Matrix3DFactory.CreateScale
(0.5, -0.5, 0.5);
var world = centerAtOrigin*
scale*
results[0].
Transformation;
var vp =
Matrix3DFactory.
CreateViewportTransformation
(Viewport.ActualWidth,
Viewport.ActualHeight);
var m =
Matrix3DFactory.
CreateViewportProjection
(world,
Matrix3D.Identity,
markerDetector.
Projection, vp);
Imagem.Projection =
new Matrix3DProjection
{ProjectionMatrix = m};
}
});
};
}
开发者ID:joaolimiere,项目名称:Artigos,代码行数:57,代码来源:MainPage.xaml.cs
示例9: CaptureImage
/// <summary>
/// captures images at specified time intervals
/// </summary>
/// <param name="vb">a videobrush object for the camera</param>
/// <param name="samplingFrequency">time between image captures(in minutes)</param>
/// <param name="count">number of times images are to be captured</param>
public void CaptureImage(VideoBrush vb,int samplingFrequency, int count)
{
this.count=count;
source = new EventSource(samplingFrequency, 0);
source.OnEvent += new EventSource.TickEventHandler(Source_OnEvent);
source.Start();
source.OffEvent += new EventSource.TickEventHandler(Source_OffEvent);
InitializeCamera(vb);
}
开发者ID:GarvitaBajaj,项目名称:AppSenseWindows,代码行数:15,代码来源:CameraCode.cs
示例10: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/Tutorial16%20-%20Multiple%20Viewport%20-%20Phone;component/GamePage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.viewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("viewfinderBrush")));
}
开发者ID:NinjaSteph,项目名称:SureShot,代码行数:9,代码来源:GamePage.g.i.cs
示例11: NullSource
public void NullSource ()
{
VideoBrush vb = new VideoBrush ();
Assert.Throws<NullReferenceException> (delegate {
vb.SetSource ((MediaElement) null);
}, "MediaElement");
Assert.Throws<NullReferenceException> (delegate {
vb.SetSource ((CaptureSource) null);
}, "CaptureSource");
}
开发者ID:dfr0,项目名称:moon,代码行数:10,代码来源:VideoBrushTest.cs
示例12: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/com.ninki.wallet;component/Plugins/com.phonegap.plugins.barcodescanner/BarcodeSc" +
"annerUI.xaml", System.UriKind.Relative));
this.CameraCanvas = ((System.Windows.Controls.Canvas)(this.FindName("CameraCanvas")));
this.CameraBrush = ((System.Windows.Media.VideoBrush)(this.FindName("CameraBrush")));
}
开发者ID:jmaurice,项目名称:NinkiCordova,代码行数:10,代码来源:BarcodeScannerUI.g.cs
示例13: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/LocalD;component/Pages/CameraPage.xaml", System.UriKind.Relative));
this.CameraViewbox = ((System.Windows.Controls.Viewbox)(this.FindName("CameraViewbox")));
this.ViewfinderCanvas = ((System.Windows.Controls.Canvas)(this.FindName("ViewfinderCanvas")));
this.ViewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("ViewfinderBrush")));
}
开发者ID:kfwls,项目名称:LocalD,代码行数:10,代码来源:CameraPage.g.i.cs
示例14: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/TaskyWinPhone;component/PageCam.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.viewfinderCanvas = ((System.Windows.Controls.Canvas)(this.FindName("viewfinderCanvas")));
this.viewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("viewfinderBrush")));
}
开发者ID:RafasTavares,项目名称:AppTaskXamarin,代码行数:10,代码来源:PageCam.g.cs
示例15: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/Tutorial8%20-%20Optical%20Marker%20Tracking%20-%20Silverlight;component/GamePage" +
".xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.viewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("viewfinderBrush")));
}
开发者ID:NinjaSteph,项目名称:SureShot,代码行数:10,代码来源:GamePage.g.i.cs
示例16: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/SmartParking;component/BarcodeScanner.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.viewfinderBrush = ((System.Windows.Media.VideoBrush)(this.FindName("viewfinderBrush")));
this.txtDebug = ((System.Windows.Controls.TextBlock)(this.FindName("txtDebug")));
this.ShutterButton = ((System.Windows.Controls.Button)(this.FindName("ShutterButton")));
}
开发者ID:neovasolutions,项目名称:MSTeam_SmartParkingSystem,代码行数:11,代码来源:BarcodeScanner.g.i.cs
示例17: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/SmartLib;component/ScanPage2.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this._previewRect = ((System.Windows.Shapes.Rectangle)(this.FindName("_previewRect")));
this.previewVideo = ((System.Windows.Media.VideoBrush)(this.FindName("previewVideo")));
this._previewTransform = ((System.Windows.Media.CompositeTransform)(this.FindName("_previewTransform")));
}
开发者ID:chovik,项目名称:SmartLib-WP7,代码行数:11,代码来源:ScanPage2.g.cs
示例18: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
c = new CaptureSource();
c.VideoCaptureDevice = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices().First();
var vidBrush = new VideoBrush();
vidBrush.SetSource(c);
ViewPort.Fill = vidBrush;
}
开发者ID:nitzo,项目名称:MegaStarz,代码行数:12,代码来源:MainPage.xaml.cs
示例19: UserControl_Loaded
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
// Initialize the webcam
captureSource = new CaptureSource();
captureSource.VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
// Fill the Viewport Rectangle with the VideoBrush
var vidBrush = new VideoBrush();
vidBrush.SetSource(captureSource);
Viewport.Fill = vidBrush;
}
开发者ID:amoldeshpande,项目名称:slartoolkit,代码行数:11,代码来源:MainPage.xaml.cs
示例20: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/RealtimeFilterDemo;component/MainPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.BackgroundVideoBrush = ((System.Windows.Media.VideoBrush)(this.FindName("BackgroundVideoBrush")));
this.StatusTextBlock = ((System.Windows.Controls.TextBlock)(this.FindName("StatusTextBlock")));
this.FrameRateTextBlock = ((System.Windows.Controls.TextBlock)(this.FindName("FrameRateTextBlock")));
}
开发者ID:Rob-Kachmar,项目名称:real-time-filter-demo,代码行数:11,代码来源:MainPage.g.i.cs
注:本文中的System.Windows.Media.VideoBrush类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论