public void Apply()
        {
            AdornmentLogo logoTool = GisEditor.ActiveMap.MapTools.OfType <AdornmentLogo>().FirstOrDefault();

            if (logoTool != null)
            {
                if (SelectedLogoMode == LogoMode.None)
                {
                    logoTool.IsEnabled = false;
                    logoTool.LogoPath  = "";
                }
                else
                {
                    logoTool.IsEnabled         = true;
                    logoTool.Source            = Preview;
                    logoTool.Left              = Left;
                    logoTool.Top               = Top;
                    logoTool.AdornmentLocation = SelectedLocation;
                    logoTool.LogoPath          = LogoPath;
                    if (SelectedSizeMode == LogoSizeMode.Auto)
                    {
                        logoTool.ImageStretchMode = Stretch.None;
                        logoTool.Width            = logoTool.Source.Width;
                        logoTool.Height           = logoTool.Source.Height;
                    }
                    else
                    {
                        logoTool.Width            = Width;
                        logoTool.Height           = Height;
                        logoTool.ImageStretchMode = Stretch.Fill;
                    }
                }
            }
        }
示例#2
0
 private GeoImage GetGeoImage(AdornmentLogo adornmentLogo)
 {
     if (File.Exists(adornmentLogo.LogoPath))
     {
         var imgStream = new MemoryStream(File.ReadAllBytes(adornmentLogo.LogoPath));
         imgStream.Seek(0, SeekOrigin.Begin);
         return(new GeoImage(imgStream));
     }
     else
     {
         var img = adornmentLogo.Source as BitmapImage;
         return(GetGeoImage(img));
     }
 }
 public LogoViewModel()
 {
     if (GisEditor.ActiveMap != null)
     {
         AdornmentLogo logoTool = GisEditor.ActiveMap.MapTools.OfType <AdornmentLogo>().FirstOrDefault();
         if (logoTool != null)
         {
             SelectedLocation = logoTool.AdornmentLocation;
             SelectedLogoMode = logoTool.IsEnabled ? LogoMode.Custom : LogoMode.None;
             SelectedSizeMode = logoTool.ImageStretchMode == Stretch.None ? LogoSizeMode.Auto : LogoSizeMode.FixedSize;
             Width            = (int)logoTool.Width;
             Height           = (int)logoTool.Height;
             if (logoTool.IsEnabled)
             {
                 Left = logoTool.Left;
                 Top  = logoTool.Top;
             }
             LogoPath = logoTool.LogoPath;
         }
     }
 }
示例#4
0
 public ImagePrinterLayerAdapter(AdornmentLogo adornmentLogo)
 {
     this.adornmentLogo = adornmentLogo;
 }