当前位置: 首页>>代码示例>>C#>>正文


C# IRaster.PaintColorSchemeToBitmap方法代码示例

本文整理汇总了C#中IRaster.PaintColorSchemeToBitmap方法的典型用法代码示例。如果您正苦于以下问题:C# IRaster.PaintColorSchemeToBitmap方法的具体用法?C# IRaster.PaintColorSchemeToBitmap怎么用?C# IRaster.PaintColorSchemeToBitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRaster的用法示例。


在下文中一共展示了IRaster.PaintColorSchemeToBitmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapRasterLayer

        /// <summary>
        /// Creates a new instance of a Raster layer, and will create a "FallLeaves" image based on the
        /// raster values.
        /// </summary>
        /// <param name="raster">The raster to use</param>
        public MapRasterLayer(IRaster raster):base(raster)
        {
            string imageFile = Path.ChangeExtension(raster.Filename, ".bmp");
            if (File.Exists(imageFile)) File.Delete(imageFile);

            IRasterSymbolizer rs = new RasterSymbolizer();
            rs.Raster = raster;
            rs.Scheme.ApplyScheme(ColorSchemes.FallLeaves, raster);
            Bitmap bmp = new Bitmap(raster.NumColumns, raster.NumRows);
            bmp.Save(imageFile);
            raster.PaintColorSchemeToBitmap(rs, bmp, raster.ProgressHandler);
            bmp.Save(imageFile);
            bmp.Dispose();

            ImageData id = new ImageData(imageFile);
            id.Bounds.AffineCoefficients = raster.Bounds.AffineCoefficients;
            id.WorldFile.Affine = raster.Bounds.AffineCoefficients;
            Configure(id, raster);
        }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:24,代码来源:MapRasterLayer.cs

示例2: MapRasterLayer

        /// <summary>
        /// Creates a new instance of a Raster layer, and will create a "FallLeaves" image based on the
        /// raster values.
        /// </summary>
        /// <param name="raster">The raster to use</param>
        public MapRasterLayer(IRaster raster)
            : base(raster)
        {
            base.LegendText = Path.GetFileNameWithoutExtension(raster.Filename);
            // string imageFile = Path.ChangeExtension(raster.Filename, ".png");
            // if (File.Exists(imageFile)) File.Delete(imageFile);
            if ((long)raster.NumRows * raster.NumColumns > MaxCellsInMemory)
            {
                // For huge images, assume that GDAL or something was needed anyway,
                // and we would rather avoid having to re-create the pyramids if there is any chance
                // that the old values will work ok.
                string pyrFile = Path.ChangeExtension(raster.Filename, ".mwi");
                if (File.Exists(pyrFile) && File.Exists(Path.ChangeExtension(pyrFile, ".mwh")))
                {
                    BitmapGetter = new PyramidImage(pyrFile);
                    base.LegendText = Path.GetFileNameWithoutExtension(raster.Filename);
                }
                else
                {
                    BitmapGetter = CreatePyramidImage(pyrFile, DataManager.DefaultDataManager.ProgressHandler);
                }
            }
            else
            {
                // Ensure smaller images match the scheme.
                Bitmap bmp = new Bitmap(raster.NumColumns, raster.NumRows);
                raster.PaintColorSchemeToBitmap(Symbolizer, bmp, raster.ProgressHandler);

                var id = new InRamImage(bmp) { Bounds = { AffineCoefficients = raster.Bounds.AffineCoefficients } };
                BitmapGetter = id;
            }
        }
开发者ID:joelmuzz,项目名称:DotSpatial,代码行数:37,代码来源:MapRasterLayer.cs


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