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


C# IEntityFactory.CreateWebcamEntity方法代码示例

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


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

示例1: AugmentedBoardGameWorld

        public AugmentedBoardGameWorld(
            I2DRenderUtilities twoDRenderUtilities,
            IAssetManagerProvider assetManagerProvider,
            IEntityFactory entityFactory)
        {
            this.Entities = new List<IEntity>();

            _renderUtilities = twoDRenderUtilities;
            _assetManager = assetManagerProvider.GetAssetManager();
            _defaultFont = this._assetManager.Get<FontAsset>("font.Default");

            var canvasEntity = entityFactory.CreateCanvasEntity();

            var pointThresholdTextBox = new TextBox();
            var minPoints = new TextBox();
            var maxPoints = new TextBox();
            var alpha = new TextBox();
            var deviceWidth = new TextBox();
            var deviceHeight = new TextBox();
            var nextColor = new Button() {Text = "Show Next Color "};
            var showDiagnostics = new Button() { Text = "Show Diagnostics" };
            var showBoard = new Button() { Text = "Show Board" };
            var nextDevice = new Button() { Text = "Next Device" };
            var deviceName = new TextBox();
            _fullscreen = new Button() { Text = "Fullscreen 1080" };

            var camera640x480 = new Button() { Text = "Camera 640x480" };
            camera640x480.Click += (sender, args) =>
            {
                deviceWidth.Text = "640";
                deviceHeight.Text = "480";
            };
            var camera720p = new Button() { Text = "Camera 720p" };
            camera720p.Click += (sender, args) =>
            {
                deviceWidth.Text = "1080";
                deviceHeight.Text = "720";
            };
            var camera1080p = new Button() { Text = "Camera 1080p" };
            camera1080p.Click += (sender, args) =>
            {
                deviceWidth.Text = "1920";
                deviceHeight.Text = "1080";
            };

            var pointThresholdEntry = new HorizontalContainer();
            pointThresholdEntry.AddChild(new Label() { Text = "Point Threshold: "}, "100");
            pointThresholdEntry.AddChild(pointThresholdTextBox, "*");

            var minPointsEntry = new HorizontalContainer();
            minPointsEntry.AddChild(new Label() { Text = "Min. Points: " }, "100");
            minPointsEntry.AddChild(minPoints, "*");

            var maxPointsEntry = new HorizontalContainer();
            maxPointsEntry.AddChild(new Label() { Text = "Max. Points: " }, "100");
            maxPointsEntry.AddChild(maxPoints, "*");

            var renderAlphaEntry = new HorizontalContainer();
            renderAlphaEntry.AddChild(new Label() { Text = "Render Alpha: " }, "100");
            renderAlphaEntry.AddChild(alpha, "*");

            var deviceWidthEntry = new HorizontalContainer();
            deviceWidthEntry.AddChild(new Label() { Text = "Device Width: " }, "100");
            deviceWidthEntry.AddChild(deviceWidth, "*");

            var deviceHeightEntry = new HorizontalContainer();
            deviceHeightEntry.AddChild(new Label() { Text = "Device Height: " }, "100");
            deviceHeightEntry.AddChild(deviceHeight, "*");

            var vert = new VerticalContainer();
            vert.AddChild(pointThresholdEntry, "24");
            vert.AddChild(minPointsEntry, "24");
            vert.AddChild(maxPointsEntry, "24");
            vert.AddChild(renderAlphaEntry, "24");
            vert.AddChild(nextColor, "24");
            vert.AddChild(showDiagnostics, "48");
            vert.AddChild(showBoard, "48");
            vert.AddChild(nextDevice, "48");
            vert.AddChild(deviceName, "24");
            vert.AddChild(deviceWidthEntry, "24");
            vert.AddChild(deviceHeightEntry, "24");
            vert.AddChild(_fullscreen, "48");
            vert.AddChild(camera640x480, "48");
            vert.AddChild(camera720p, "48");
            vert.AddChild(camera1080p, "48");

            var hor = new HorizontalContainer();
            hor.AddChild(new EmptyContainer(), "*");
            hor.AddChild(vert, "200");

            var canvas = new Canvas();
            canvas.SetChild(hor);

            canvasEntity.Canvas = canvas;

            var webcamEntity = entityFactory.CreateWebcamEntity(deviceName, deviceWidth, deviceHeight);
            var detectorEntity = entityFactory.CreateDetectorEntity(webcamEntity);
            detectorEntity.X = 0;
            detectorEntity.Y = 0;
            var boardAnalyzerEntity = entityFactory.CreateBoardAnalyzerEntity(detectorEntity, pointThresholdTextBox, minPoints, maxPoints);
//.........这里部分代码省略.........
开发者ID:hach-que,项目名称:Augmented-Board-Game,代码行数:101,代码来源:AugmentedBoardGameWorld.cs


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