Background color

hyderhyder Global Mapper UserPosts: 10
edited May 2010 in SDK
In my application I've a requirement that user can change the color of sea and ground using a menu.
When i load ENC or GEOTIFF, loadlayer returns single layer, how can i change two different background color in single layer and how can i identify a sea part or ground part in single layer.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2010
    Since an ENC file is a vector file, you can change the color/drawing style of features with the normal vector style functions (like GM_SetAreaFeatureDrawStyle for areas). Just iterate through the features in a layer and change the fill color for the ocean/land areas as needed.

    For a GeoTIFF file the situation is different. Will your GeoTIFF files be palette-based? If so there is a way in the Global Mapper application to modify the palette used for a file so you could easily change one color to another. This functionality could be added to the SDK as well without too much difficulty. If it's not palette-based, then there really isn't a way to replace one color with another. You would have to create a custom in-memory raster layer copied from the loaded GeoTIFF using the GM_CreateCustomRasterLayer function, then you could modify your in-memory copies of the colors and draw from that.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • hyderhyder Global Mapper User Posts: 10
    edited May 2010
    Thanks Mike, but how can i identify that the feature is land or sea in ENC layer while iterating.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2010
    You can call GM_GetAreaFeature to get the feature information, including classification and attribute values, then examine that information to determine if it is a feature that you want to modify.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.