AutoContrast in SDK 1.32 beta

rick_edwards
rick_edwards Global Mapper User
edited October 2009 in SDK
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

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2009
    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
  • rick_edwards
    rick_edwards Global Mapper User
    edited October 2009
    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