當前位置: 首頁>>代碼示例>>C#>>正文


C# Foundation.Size類代碼示例

本文整理匯總了C#中Windows.Foundation.Size的典型用法代碼示例。如果您正苦於以下問題:C# Size類的具體用法?C# Size怎麽用?C# Size使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Size類屬於Windows.Foundation命名空間,在下文中一共展示了Size類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Windows.Foundation.Size類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。