LBitmap::SetOverlayAttributes

#include "ltwrappr.h"

virtual L_INT LBitmap::SetOverlayAttributes(nIndex, pOverlayAttributes, uFlags)

L_INT nIndex;

the overlay index

pOVERLAYATTRIBUTES pOverlayAttributes;

pointer to the overlay attributes structure

L_UINT uFlags;

flags that determine which attributes should be changed

Sets overlay attributes for a certain index.

Parameter Description
nIndex The index of the overlay being affected. This index is zero-based.
pOverlayAttributes Structure containing the overlay attributes.
uFlags Flags that determine overlay attributes should be changed. You can combine values using a bitwise OR ( | ). Possible values are:
  Value Meaning
  OVERLAYATTRIBUTES_ORIGIN [0x0001] Change the top-left position. pOverlayAttributes->ptOrigin contains the new top-left offset
  OVERLAYATTRIBUTES_COLOR [0x0002] Change the color. pOverlayAttributes->crColor contains the new color
  OVERLAYATTRIBUTES_FLAGS [0x0004] Change the flags. pOverlayAttributes->uFlags contains the new flags
  OVERLAYATTRIBUTES_BITINDEX [0x0008] Change the corresponding bitplane position. pOverlayAttributes->uBitPosition contains the new bitplane index.
  OVERLAYATTRIBUTES_DICOM [0x0010] Change the DICOM-related attributes, this includes:
    pOverlayAttributes->uRows,
    pOverlayAttributes->uColumns,
    pOverlayAttributes->szType,
    pOverlayAttributes->uBitsAllocated,
    pOverlayAttributes->szDescription,
    pOverlayAttributes->szSubtype,
    pOverlayAttributes->szLabel,
    pOverlayAttributes->nROIArea,
    pOverlayAttributes->fROIMean,
    pOverlayAttributes->fROIStandardDeviation,
    pOverlayAttributes->nNumFramesInOverlay,
    pOverlayAttributes->uImageFrameOrigin,
    pOverlayAttributes->szActivationLayer

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Some or all the overlay attributes are being changed. Before calling this function, initialize pOverlayAttributes->uStructSize to be sizeof(OVERLAYATTRIBUTES) and initialize all the attributes you are changing. You do not need to initialize the structure variables that you are not updating. For example, if you are not setting OVERLAYATTRIBUTES_ORIGIN, you do not need to initialize pOverlayAttributes-> ptOrigin.

There are several attributes in uFlags and you cannot change only one flag. If you want to change only one flag, you will first have to get all the flags and change only the flag you want. See the example for more information.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members

Topics:

Raster Image Functions: Doing Geometric Transformations

 

Resizing Considerations, Overlay Overview

Example

You can also see the example for LBitmap::SetOverlay This example will change only one of the flag attributes for all the overlays Note that OverlayAttributes.uStructSize is not initialized directly. LBitmap::GetOverlayAttributes is initializing OverlayAttributes.uStructSize

L_INT LBitmap__SetOverlayAttributesExample(HWND hWnd, LBitmap * plBitmap, L_BOOL bShow) 
{ 
   L_INT nRet; 
   L_INT i; 
   OVERLAYATTRIBUTES   OverlayAttributes; 
   for(i = 0; i < MAX_OVERLAYS; i++) 
   { 
      nRet =plBitmap->GetOverlayAttributes(i, &OverlayAttributes, sizeof(OverlayAttributes), OVERLAYATTRIBUTES_FLAGS); 
      if(nRet !=SUCCESS) 
         return nRet; 
      if(bShow) 
         OverlayAttributes.uFlags |=  OVERLAY_AUTOPAINT; 
      else 
         OverlayAttributes.uFlags &= ~OVERLAY_AUTOPAINT; 
      nRet =plBitmap->SetOverlayAttributes(i, &OverlayAttributes, OVERLAYATTRIBUTES_FLAGS); 
      if(nRet !=SUCCESS) 
         return nRet; 
   } 
   InvalidateRect(hWnd, NULL, FALSE); 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help