AutoContrast in SDK 1.32 beta

rick_edwards
Global Mapper User
Hi all,
we're currently testing the 1.32 beta SDK and the AutoContrast flag on the RasterDisplayOptions type has been replaced by a ContrastMode property that takes a ContrastMode enum type. Historically when we loaded in a background bitmap we set its opacity to some value and set the AutoContrast flag based on some config system setting. I've refactored the AutoContrast code to set the ContrastMode depending upon the original AutoContrast config flag. With AutoContrast set to false I don't set any ContrastMode on the RasterDisplayOptions for the layer and the bitmap is displayed correctly. However, with AutoContrast set to true I set the ContrastMode to be DefaultAuto but then I don't see the Bitmap.
Can you tell me what the equivalent ContrastMode setting should be for AutoContrast? I've tried various other settings but to no avail. Are there any other flags or properties I should be setting?
Thanks
Rick Edwards
we're currently testing the 1.32 beta SDK and the AutoContrast flag on the RasterDisplayOptions type has been replaced by a ContrastMode property that takes a ContrastMode enum type. Historically when we loaded in a background bitmap we set its opacity to some value and set the AutoContrast flag based on some config system setting. I've refactored the AutoContrast code to set the ContrastMode depending upon the original AutoContrast config flag. With AutoContrast set to false I don't set any ContrastMode on the RasterDisplayOptions for the layer and the bitmap is displayed correctly. However, with AutoContrast set to true I set the ContrastMode to be DefaultAuto but then I don't see the Bitmap.
Can you tell me what the equivalent ContrastMode setting should be for AutoContrast? I've tried various other settings but to no avail. Are there any other flags or properties I should be setting?
Thanks
Rick Edwards
Comments
-
Rick,
I've just tested this with the latest v1.32 beta and it seems to work fine. Here is the sample code that I used to set both translucency and the same auto-contrast settings as just setting the auto-contrast flag to TRUE had in the old versions:
// DEBUG: Set contrast
GM_RasterDisplayOptions_t theDispOpts;
::memset( &theDispOpts, 0, sizeof theDispOpts );
theDispOpts.mSize = sizeof( theDispOpts );
GM_GetRasterDisplayOptions( theLayerHandle, &theDispOpts );
theDispOpts.mContrastMode = GM_Contrast_DefaultAuto;
theDispOpts.mContrastNumStdDev = 2.0;
theDispOpts.mTranslucency = 128;
GM_SetRasterDisplayOptions( theLayerHandle, &theDispOpts );
If you still have trouble, can you provide me with your code where you setup the options to examine?
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Thanks Mike,
managed to track it down to a marshalling issue between our managed wrapper and global mapper SDK. Seems to be working fine now.
Regards
Rick
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 645 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 180 Announcement and News
- 926 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 575 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 242 How I use Global Mapper
- 108 Global Mapper Forum Website