Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.11.1
LEADTOOLS Raster Imaging C DLL Help

L_SetOverlayAttributes

Show in webframe

#include "l_bitmap.h"

L_LTKRN_API L_INT L_SetOverlayAttributes (pBitmap, nIndex, pOverlayAttributes, uFlags);

pBITMAPHANDLE pBitmap;

/* pointer to the main bitmap handle */

L_INT nIndex;

/* the overlay index */

pOVERLAYATTRIBUTES pOverlayAttributes;

/* pointer to the overlay attributes structure */

L_UINT uFlags;

/* flags that determine which attributes should be set */

Sets the overlay attributes for the overlay at the specified index.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the main bitmap.

nIndex

The index of the overlay for which the attributes are being set. This index is zero-based.

pOverlayAttributes

Structure containing the overlay attributes to set.

uFlags

Flags that determine which overlay attributes to set. You can or these flags. Possible values are:

 

Value

Meaning

 

OVERLAYATTRIBUTES_ORIGIN

[0x0001] The top-left position should be changed. pOverlayAttributes->ptOrigin contains the new top-left offset

 

OVERLAYATTRIBUTES_COLOR

[0x0002] Indicates the color should be changed. pOverlayAttributes->crColor contains the new color

 

OVERLAYATTRIBUTES_FLAGS

[0x0004] Indicates the flags should be changed. pOverlayAttributes->uFlags contains the new flags

 

OVERLAYATTRIBUTES_BITINDEX

[0x0008] Indicates the corresponding bitplane position should be changed. pOverlayAttributes->uBitPosition contains the new bitplane index.

 

OVERLAYATTRIBUTES_DICOM

[0x0010] Indicates that the DICOM-related attributes should be changed, 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

This function can be used to set some or all the overlay attributes. Before calling this function, initialize pOverlayAttributes->uStructSize to be sizeof(OVERLAYATTRIBUTES) and initialize all the attributes to be set or changed. You do not need to initialize the structure variables that you are not setting or changing. For example, if OVERLAYATTRIBUTES_ORIGIN is not set in uFlags, 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, Linux.

See Also

Functions:

L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_GetOverlayBitmap, L_GetOverlayAttributes, L_UpdateBitmapOverlayBits, L_GetOverlayCount, OVERLAYATTRIBUTES, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap

Topics:

Raster Image Functions: Combining Images

 

Overlay Overview

Example

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

 L_INT SetOverlayAttributesExample(HWND            hWnd,
                                                  pBITMAPHANDLE   pBitmap,
                                                  L_BOOL          bShow)
{
   L_INT nRet;
   L_INT             i;
   OVERLAYATTRIBUTES OverlayAttributes;

   for(i = 0; i < MAX_OVERLAYS; i++)
   {
      nRet = L_GetOverlayAttributes(pBitmap, i, &OverlayAttributes, sizeof(OverlayAttributes), OVERLAYATTRIBUTES_FLAGS);
      if(nRet != SUCCESS)
         return nRet;
      if(bShow)
         OverlayAttributes.uFlags |=  OVERLAY_AUTOPAINT;
      else
         OverlayAttributes.uFlags &= ~OVERLAY_AUTOPAINT;
      nRet = L_SetOverlayAttributes(pBitmap, i, &OverlayAttributes, OVERLAYATTRIBUTES_FLAGS);
      if(nRet != SUCCESS)
         return nRet;
   }

   InvalidateRect(hWnd, NULL, FALSE);
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.