zoukankan      html  css  js  c++  java
  • ArcGIS Pro自定义图标

    来自:https://community.esri.com/thread/250077-custom-control-and-handling-images

    Let say in xaml

    <Image x:Name="ImgStatus" Grid.Column="1" Grid.Row="0" Width="32" Height="32" Source="pack://application:,,,/[your name space];component/[folder name if you put your image into the folder]/[your image name].pngVerticalAlignment="Top"></Image>

    In cs file

     private void SetStatus()
            {
                this.ImgStatus.Source = this.BuildImage([Your desire image name]);
            }


    /// <summary>
            /// Create bitmap image source
            /// </summary>
            /// <param name="imageName"></param>
            /// <returns></returns>
            private ImageSource BuildImage(string imageName)
            {
                return new BitmapImage(PackUriForResource(imageName));
            }
            /// <summary>
            /// Create wpf uri, make sure the image type is assembly resource
            /// </summary>
            /// <param name="resourceName"></param>
            /// <returns></returns>
            private Uri PackUriForResource(string resourceName)
            {
                string asm = System.IO.Path.GetFileNameWithoutExtension(
                    System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                return new Uri(string.Format("pack://application:,,,/{0};component/[Your image folder path]/{1}", asm, resourceName), UriKind.Absolute);
            }

    Make sure you replace those variable with [] properly from the sample code.  and try i

  • 相关阅读:
    消息中间件
    docker 安装elasticSearch6.7.1
    Curl实现ElasticSearch的增删改查
    docker 容器的mysql主从复制
    linux上docker安装centos7.2
    linux安装docker
    调用 CURL 使用正则抓取信息
    linux 一键安装lnmp环境
    laravel框架实现数据的删除和修改
    laravel 实现增 与查
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12622481.html
Copyright © 2011-2022 走看看