Пример #1
0
        private void AddImage(Panel panel, Stretch stretch)
        {
            var border = new Border()
            {
                Child = new Image(Model.ImageUri)
                {
                    Width   = 280,
                    Height  = 280,
                    Stretch = stretch
                }
            };

            border.SetResourceReference(Border.BorderBrushProperty, SystemResources.AltHighBrushKey);

            panel.Children.Add(new StackPanel()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin      = new Thickness(20),
                Orientation = Orientation.Vertical,
                Children    =
                {
                    new Label()
                    {
                        HorizontalAlignment = HorizontalAlignment.Center,
                        Margin        = new Thickness(3),
                        Text          = stretch.ToString(),
                        TextAlignment = TextAlignment.Center,
                    },
                    border
                }
            });
        }
Пример #2
0
        public override IEnumerable <SvgAttribute> GetAttributes()
        {
            var baseAttributes = base.GetAttributes();

            if (baseAttributes != null)
            {
                foreach (var attr in baseAttributes)
                {
                    yield return(attr);
                }
            }

            var ci = CultureInfo.InvariantCulture;

            yield return(new SvgAttribute("fit-to-path", null,
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => FitToPath.ToString(ci),
                                          v => FitToPath = SvgAttribute.ParseBooleanAttribute(v)
                                          ));

            yield return(new SvgAttribute("stretch", null,
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => Stretch.ToString(ci),
                                          v => Stretch = SvgAttribute.ParseBooleanAttribute(v)
                                          ));

            yield return(new SvgAttribute("original-font-size", "0",
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => OriginalFontSize.ToString(ci),
                                          v => OriginalFontSize = SvgAttribute.ParseFloatAttribute(v)
                                          ));

            yield return(new SvgAttribute("fit-to-path-step", "1",
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => FitToPathStep.ToString(ci),
                                          v => FitToPathStep = SvgAttribute.ParseFloatAttribute(v)
                                          ));

            yield return(new SvgAttribute("path-start", "0",
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => PathStart.ToString(ci),
                                          v => PathStart = SvgAttribute.ParseFloatAttribute(v)
                                          ));

            yield return(new SvgAttribute("path-end", "1",
                                          XmlNamespace.AurigmaVectorObjects,
                                          () => PathEnd.ToString(ci),
                                          v => PathEnd = SvgAttribute.ParseFloatAttribute(v)
                                          ));
        }
Пример #3
0
        private string GetFaceNameJP()
        {
            var style   = Style.ToString();
            var weight  = Weight.ToString();
            var stretch = Stretch.ToString();

            string[] l =
            {
                //上記辞書で出来る限り日本語化
                STRETCH.GetOrDefault(stretch, stretch),
                WEIGHT.GetOrDefault(weight,   weight),
                STYLE.GetOrDefault(style,     style)
            };
            var simulated = ((IsBoldSimulated) || (IsObliqueSimulated)) ? " (Simulated)" : "";

            //スペースで区切って整形
            var s = string.Join(" ", l.Where(x => !string.IsNullOrEmpty(x)));

            return(string.IsNullOrEmpty(s) ? "標準" + simulated : s + simulated);
        }