ThinkGeo.MapSuite.Layers.NativeImage

Please upgrade to version 12 (Search ThinkGeo.Core on NuGet) if possible. Version 12 works with both .NET Framework and .NET Core, has much less dependencies and many other benifits over 10.0. NativeImage Layer is included in the main package ThinkGeo.Core in Version 12. ThinkGeo.MapSuite.Layers.NativeImage is a layer extension to the Map Suite product line, it is used to draw standard image types on the map. These include .BMP, .JPG, .PNG, .TIFF, and all other image types that are supported by the .NET Framework to be loaded as a Bitmap. Each of these images will need a world file associated with it. The world file contains the geospatial information pertaining to the image. Using the world file, we know its spatial position and other required information to draw it on the map relative to other images or spatial features. World files are small text files with an extension that matches the original image's extension, but with the middle character of the extension changed to a "w". If you have images that you want to use but do not have their world files, please contact the source of the image so that they can provide one for you. world files are fairly common in the GIS community. ** This is an extension for use in ThinkGeo's Map Suite product line, see below, as it cannot be used stand alone. ** Wiki Documentation: http://wiki.thinkgeo.com/wiki/map_suite_api Supported Platforms: Windows, Linux, macOS, iOS, Android - Compatible Products - Map Suite Desktop for WPF Map Suite Desktop for WinForms Map Suite Mobile for Android Map Suite Mobile for iOS Map Suite Web for WebForms Map Suite Web for MVC Map Suite Web for WebAPI


Keywords
.NET, GIS, Map, MapSuite, Mapping, Native, NativeImage, Spatial, Suite, ThinkGeo, layers-featuresources, map-suite, native-image, stream, winforms
Install
Install-Package ThinkGeo.MapSuite.Layers.NativeImage -Version 10.6.5

Documentation

Stream Loading For Native Image Sample for WinForms

Description

As an alternative to loading an Image with the image file from the file system, you can choose to pass your own stream. This project shows you how to use the event StreamLoading of GdiPlusRasterSource for this purpose. In this project, we show how to do this using a Tiff image but you can also use that event for ShapeFileFeatureSource as we show in a previous project “Shapefile Encryption”. Keep in mind that this technique only works with images besides MrSid, ECW and Jpeg2000. These types of images do not work because the providers do not support streams in their decoding SDKs.

Please refer to Wiki for the details.

Screenshot

Requirements

This sample makes use of the following NuGet Packages

MapSuite 10.0.0

About the Code

NativeImageRasterLayer worldImageLayer = new NativeImageRasterLayer(@"world.tif");
((NativeImageRasterSource)(worldImageLayer.ImageSource)).StreamLoading += new EventHandler<StreamLoadingEventArgs>(MainForm_StreamLoading);
worldImageLayer.UpperThreshold = double.MaxValue;
worldImageLayer.LowerThreshold = 0;
worldImageLayer.IsGrayscale = false;

Getting Help

Map Suite Desktop for Winforms Wiki Resources

Map Suite Desktop for Winforms Product Description

ThinkGeo Community Site

ThinkGeo Web Site

Key APIs

This example makes use of the following APIs:

About Map Suite

Map Suite is a set of powerful development components and services for the .Net Framework.

About ThinkGeo

ThinkGeo is a GIS (Geographic Information Systems) company founded in 2004 and located in Frisco, TX. Our clients are in more than 40 industries including agriculture, energy, transportation, government, engineering, software development, and defense.