• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Foundation.Size类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.Foundation.Size的典型用法代码示例。如果您正苦于以下问题:C# Size类的具体用法?C# Size怎么用?C# Size使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Size类属于Windows.Foundation命名空间,在下文中一共展示了Size类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Arrange

 public override void Arrange(Size finalSize)
 {
     base.Arrange(DesiredSize);
     // Call method to arrange the marker
     SetIndicatorTransforms();
     PositionMarker();
 }
开发者ID:jm991,项目名称:HeliosApp,代码行数:7,代码来源:MarkerIndicator.cs


示例2: GetEffectInternalAsync

        protected override MaybeTask<IImageProvider> GetEffectInternalAsync(IImageProvider source, Size sourceSize, Size renderSize)
        {
            m_radialGradient.CenterPoint = new Point(m_centerX, m_centerY);
            m_radialGradient.EllipseRadius = new EllipseRadius(m_radiusX, m_radiusY);

            return new MaybeTask<IImageProvider>(m_gradientImageSource);
        }
开发者ID:modulexcite,项目名称:Lumia-imaging-sdk,代码行数:7,代码来源:RadialGradientSourceEffectProcessor.cs


示例3: DataContext

 /// <summary>
 /// Private contructor.
 /// </summary>
 private DataContext()
 {
     PreviewResolutionStream = new MemoryStream();
     FullResolutionStream = new MemoryStream();
     FullResolution = new Size(DefaultPreviewResolutionWidth, DefaultPreviewResolutionHeight);
     PreviewResolution = new Size(DefaultPreviewResolutionWidth, DefaultPreviewResolutionHeight);
 }
开发者ID:TheHypnotoad,项目名称:filter-effects,代码行数:10,代码来源:DataContext.cs


示例4: ArrangeOverride

        protected override Size ArrangeOverride(Size finalSize)
        {
            var panel = ItemsPanelRoot as ItemsWrapGrid;
            if (panel != null)
            {
                if (MinItemWidth == 0)
                {
                    throw new ArgumentException("You need to set MinItemHeight and MinItemWidth to a value greater than 0");
                }

                var availableWidth = finalSize.Width - (Padding.Right + Padding.Left);

                var numColumns = Math.Floor(availableWidth / MinItemWidth);
                numColumns = numColumns == 0 ? 1 : numColumns;

                //Not used yet (for horizontal scrolling scenarios)
                //var numRows = Math.Ceiling(this.Items.Count / numColumns);

                var itemWidth = availableWidth / numColumns;

                panel.ItemWidth = itemWidth;
                panel.ItemHeight = 120;
            }

            return base.ArrangeOverride(finalSize);
        }
开发者ID:Flogex,项目名称:Vertretungsplan,代码行数:26,代码来源:AdaptiveGridView.cs


示例5: GetNewFrameAndApplyEffect

        public async Task GetNewFrameAndApplyEffect(IBuffer frameBuffer, Size frameSize)
        {
            if (_semaphore.WaitOne(500))
            {
                var scanlineByteSize = (uint)frameSize.Width * 4; // 4 bytes per pixel in BGRA888 mode
                var bitmap = new Bitmap(frameSize, ColorMode.Bgra8888, scanlineByteSize, frameBuffer);

                if (_filterEffect != null)
                {
                    var renderer = new BitmapRenderer(_filterEffect, bitmap);
                    await renderer.RenderAsync();
                }
                else if (_customEffect != null)
                {
                    var renderer = new BitmapRenderer(_customEffect, bitmap);
                    await renderer.RenderAsync();
                }
                else
                {
                    var renderer = new BitmapRenderer(_cameraPreviewImageSource, bitmap);
                    await renderer.RenderAsync();
                }

                _semaphore.Release();
            }
        }
开发者ID:Rob-Kachmar,项目名称:real-time-filter-demo,代码行数:26,代码来源:NokiaImagingSDKEffects.cs


示例6: ThumbnailRenderer

 public ThumbnailRenderer(Size thumbnailSize, Action<IImageProcessor, SoftwareBitmap> thumbnailCompleteAction)
 {
     m_thumbnailSize = thumbnailSize;
     m_thumbnailCompleteAction = thumbnailCompleteAction;
     m_bitmapRenderer = new SoftwareBitmapRenderer();
     m_bitmapRenderer.Size = thumbnailSize;
 }
开发者ID:modulexcite,项目名称:Lumia-imaging-sdk,代码行数:7,代码来源:ThumbnailRenderer.cs


示例7: ArrangeOverride

        protected override Size ArrangeOverride(Size finalSize)
        {
            // Get the collection of children
            UIElementCollection mychildren = Children;

            // Get total number of children
            int count = mychildren.Count;

            // Arrange children
            // We're only allowing 9 children in this panel.  More children will get a 0x0 layout slot.
            int i;
            for (i = 0; i < count; i++)
            {

                // Get (left, top) origin point for the element in the 3x3 block
                Point cellOrigin = GetOrigin(i, 12, new Size(50, 50));

                // Arrange child
                // Get desired height and width. This will not be larger than 100x100 as set in MeasureOverride.
              //  var cellViewModel = contentPresenter.DataContext as CellViewModel;
                double dw = mychildren[i].DesiredSize.Width;
                double dh = mychildren[i].DesiredSize.Height;

                mychildren[i].Arrange(new Rect(cellOrigin.X, cellOrigin.Y, dw, dh));
            }

            // Return final size of the panel
            return finalSize;
        }
开发者ID:abdulbaruwa,项目名称:CrossSharp,代码行数:29,代码来源:BoardCanvas.cs


示例8: MeasureOverride

 protected override Size MeasureOverride(Size availableSize)
 {
     this.availableSize = availableSize;
     // Children[0] is the outer ScrollViewer
     this.Children[0].Measure(availableSize);
     return this.Children[0].DesiredSize;
 }
开发者ID:janaks09,项目名称:Windows10-Samples,代码行数:7,代码来源:PTRBorder.cs


示例9: ArrangeOverride

        protected override Size ArrangeOverride(Size finalSize)
        {
            Clip = new RectangleGeometry { Rect = new Rect(0, 0, finalSize.Width, finalSize.Height) };

            double positionLeft = 0d;

            foreach (var item in Children)
            {
                if (item != null)
                {
                    Size desiredSize = item.DesiredSize;

                    if (!double.IsNaN(desiredSize.Width) && !double.IsNaN(desiredSize.Height))
                    {
                        var rect = new Rect(positionLeft, 0, desiredSize.Width, desiredSize.Height);
                        item.Arrange(rect);
                        item.RenderTransform = new TranslateTransform();
                        positionLeft += desiredSize.Width;
                    }
                }
            }

            _templateApplied = true;

            return finalSize;
        }
开发者ID:7illusions,项目名称:LoopingFlipView,代码行数:26,代码来源:LoopingItemsPanel.cs


示例10: InternalMeasure

        private Size InternalMeasure(
            Size availableSize,
            Func<UIElement, Size, Size> childMesaureCallback,
            Func<Size, Size> finalSize) {

            double requiredHeight = 0;
            double requiredWidth = 0;

            var availableHeight = double.IsInfinity(availableSize.Height)
                                         ? Window.Current.Bounds.Height
                                         : availableSize.Height;
            var availableWidth = double.IsInfinity(availableSize.Width)
                                        ? Window.Current.Bounds.Width
                                        : availableSize.Width;

            foreach (var child in Children) {
                var childMeasure = childMesaureCallback(child, new Size(requiredWidth, requiredHeight));
                requiredHeight = childMeasure.Height;
                requiredWidth = childMeasure.Width;
            }

            requiredHeight = Math.Max(requiredHeight, 1);
            requiredWidth = Math.Max(requiredWidth, 1);

            scale = Math.Min(availableWidth / requiredWidth, availableHeight / requiredHeight);

            foreach (var child in Children) {
                child.Measure(new Size(availableWidth, availableHeight));
            }

            return finalSize(new Size(requiredWidth, requiredHeight));
        }
开发者ID:cloudsdaleapp,项目名称:cloudsdale-metro,代码行数:32,代码来源:ViewboxPanel.cs


示例11: ArrangeOverride

 protected override Size ArrangeOverride(Size finalSize)
 {
     this.finalSize = finalSize;
     // Children[0] is the outer ScrollViewer
     this.Children[0].Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height));
     return finalSize;
 }
开发者ID:janaks09,项目名称:Windows10-Samples,代码行数:7,代码来源:PTRBorder.cs


示例12: ArrangeOverride

        protected override Size ArrangeOverride(Size finalSize)
        {
            double width = widthColumns.Sum();
            double height = rowHeigh.Sum();
            if (width > finalSize.Width)
                for (int i = 0; i < widthColumns.Count; i++)
                    widthColumns[i] = widthColumns[i] * finalSize.Width / width;

            double xOffset = 0.0;
            double yOffset = 0.0;
            int row = 0;
            int column = 0;
            foreach (UIElement child in this.Children)
            {
                if (column > 0)
                    xOffset += widthColumns[column - 1];
                child.Arrange(new Rect(xOffset, yOffset, widthColumns[column], rowHeigh[row]));
                column++;
                if (widthColumns.Count != column)
                    continue;

                yOffset += rowHeigh[row];
                row++;
                column = 0;
                xOffset = 0;

            }
            return new Size(width, height);
        }
开发者ID:Dimamar,项目名称:Workout,代码行数:29,代码来源:NColumnPannel.cs


示例13: ArrangeOverride

        protected override Size ArrangeOverride(Size arrangeSize)
        {
            Point middle = new Point(arrangeSize.Width / 2, arrangeSize.Height / 2);
            UIElementCollection mychildren = Children;

            foreach (UIElement element in mychildren)
            {
                double x = 0.0;
                double y = 0.0;
                double left = GetLeft(element);
                if (!double.IsNaN(left))
                {
                    x = left;
                }

                double top = GetTop(element);
                if (!double.IsNaN(top))
                {
                    y = top;
                }

                element.Arrange(new Rect(new Point(middle.X + x, middle.Y + y), element.DesiredSize));
            }

            return arrangeSize;
        }
开发者ID:xianguoguo,项目名称:mindmapapp,代码行数:26,代码来源:CartesianCanvas.cs


示例14: ExecuteTakePictureCommand

        private async void ExecuteTakePictureCommand()
        {
            try
            {
                Busy = true;

                StorageFile file = null;

                if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Media.Capture.CameraCaptureUI"))
                {
                    // Using Windows.Media.Capture.CameraCaptureUI API to capture a photo
                    CameraCaptureUI dialog = new CameraCaptureUI();
                    Size aspectRatio = new Size(16, 9);
                    dialog.PhotoSettings.CroppedAspectRatio = aspectRatio;

                    file = await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);
                }

                if (file != null)
                {
                    // Copy the file into local folder
                    await file.CopyAsync(ApplicationData.Current.LocalFolder, file.Name, NameCollisionOption.ReplaceExisting);
                    // Save in the ToDoItem
                    TodoItem.ImageUri = new Uri("ms-appdata:///local/" + file.Name);
                }
            }
            finally { Busy = false; }
        }
开发者ID:MuffPotter,项目名称:201505-MVA,代码行数:28,代码来源:TodoItemViewModel.cs


示例15: ArrangeOverride

 protected override Size ArrangeOverride(Size finalSize)
 {
     var r = new RectangleGeometry();
     r.Rect = new Rect(new Point(0, 0), finalSize);
     Clip = r;
     return base.ArrangeOverride(finalSize);
 }
开发者ID:GSonofNun,项目名称:FedoraControls,代码行数:7,代码来源:SwipeActionItem.cs


示例16: ArrangeOverride

        /// <summary>
        /// When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class. 
        /// </summary>
        /// <param name="finalSize"></param>
        /// <returns></returns>
        protected override Size ArrangeOverride(Size finalSize)
        {
            //Arrange all children based on the geometric equations for the circle.
            if (Children.Count == 0)
                return finalSize;
            double _angle = 0.2;
            //Degrees converted to Radian by multiplying with PI/180
            double _incrementalAngularSpace = (180.0 / Children.Count) * (Math.PI / 180);
            //An approximate radii based on the avialable size , obviusly a better approach is needed here.
            double radiusX = finalSize.Width / 2.4;
            double radiusY = finalSize.Height / 2.4;
            foreach (UIElement elem in Children)
            {
                //Calculate the point on the circle for the element
                Point childPoint = new Point(Math.Cos(_angle) * radiusX, -Math.Sin(_angle) * radiusY);
                //Offsetting the point to the Avalable rectangular area which is FinalSize.
                Point actualChildPoint = new Point(finalSize.Width / 2 + childPoint.X - elem.DesiredSize.Width / 2, finalSize.Height / 2 + childPoint.Y - elem.DesiredSize.Height / 2);
                //Call Arrange method on the child element by giving the calculated point as the placementPoint.
                elem.Arrange(new Rect(actualChildPoint.X, actualChildPoint.Y, elem.DesiredSize.Width, elem.DesiredSize.Height));
                //Calculate the new _angle for the next element
                _angle += _incrementalAngularSpace;
            }

            return finalSize;
        }
开发者ID:dtomovdimitrov,项目名称:Tangible,代码行数:30,代码来源:RadialPanel.cs


示例17: MeasureOverride

        protected override Size MeasureOverride(Size availableSize)
        {
            availableSize = NormalizeSize(availableSize);

            double width = availableSize.Width / this.MaxItems;
            double height = width / this.AspectRatio;

            if (height < MinHeight)
            {
                height = MinHeight;
                width = height * this.AspectRatio;
            }

            if (height > MaxHeight)
            {
                height = MaxHeight;
                width = height * this.AspectRatio;
            }

            _panel.ItemWidth = Math.Round(width);
            _panel.ItemHeight = Math.Round(height);

            this.Position = -this.Index * width;

            return base.MeasureOverride(new Size(availableSize.Width, height));
        }
开发者ID:ridomin,项目名称:waslibs,代码行数:26,代码来源:Carousel.cs


示例18: GetEffectInternalAsync

        protected override MaybeTask<IImageProvider> GetEffectInternalAsync(IImageProvider source, Size sourceSize, Size renderSize)
        {
            ((IImageConsumer)Effect).Source = source;
            ((SpotlightEffect)Effect).Position = new Windows.Foundation.Point(sourceSize.Width / 2, sourceSize.Height / 2);

            return new MaybeTask<IImageProvider>(Effect);
        }
开发者ID:modulexcite,项目名称:Lumia-imaging-sdk,代码行数:7,代码来源:SpotlightFilterProcessor.cs


示例19: MeasureOverride

        protected override Size MeasureOverride(Size availableSize)
        {
            // Just take up all of the width
            Size finalSize = new Size { Width = availableSize.Width };
            double x = 0;
            double rowHeight = 0d;
            foreach (var child in Children)
            {
                // Tell the child control to determine the size needed
                child.Measure(availableSize);

                x += child.DesiredSize.Width;
                if (x > availableSize.Width)
                {
                    // this item will start the next row
                    x = child.DesiredSize.Width;

                    // adjust the height of the panel
                    finalSize.Height += rowHeight;
                    rowHeight = child.DesiredSize.Height;
                }
                else
                {
                    // Get the tallest item
                    rowHeight = Math.Max(child.DesiredSize.Height, rowHeight);
                }
            }

            // Add the final height
            finalSize.Height += rowHeight;
            return finalSize;
        }
开发者ID:cdkisa,项目名称:MyNetSensors,代码行数:32,代码来源:WarpPanel.cs


示例20: EnsureResources

        void EnsureResources(ICanvasResourceCreatorWithDpi resourceCreator, Size targetSize)
        {
            if (resourceRealizationSize == targetSize && !needsResourceRecreation)
                return;

            float canvasWidth = (float)targetSize.Width;
            float canvasHeight = (float)targetSize.Height;
            sizeDim = Math.Min(canvasWidth, canvasHeight);

            if (!defaultFontSizeSet)
            {
                CurrentFontSize = sizeDim / 1.3f;
                CurrentFontSize = Math.Max((float)fontSizeSlider.Minimum, CurrentFontSize);
                CurrentFontSize = Math.Min((float)fontSizeSlider.Maximum, CurrentFontSize);
                fontSizeSlider.Value = CurrentFontSize;
                defaultFontSizeSet = true;
            }

            if (textLayout != null) 
                textLayout.Dispose();
            textLayout = CreateTextLayout(resourceCreator, canvasWidth, canvasHeight);

            if (!UniformStyle)
            {
                textLayout.SetFontSize(0, 1, CurrentUppercaseFontSize);
                textLayout.SetFontFamily(0, 1, uppercaseFontPicker.CurrentFontFamily);

                textLayout.SetFontSize(1, 2, CurrentLowercaseFontSize);
                textLayout.SetFontFamily(1, 2, lowercaseFontPicker.CurrentFontFamily);
            }

            needsResourceRecreation = false;
            resourceRealizationSize = targetSize;
        }
开发者ID:ben-sheeran,项目名称:Win2D,代码行数:34,代码来源:FontMetrics.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Capture.MediaCapture类代码示例发布时间:2022-05-26
下一篇:
C# Foundation.Rect类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap