LAnnStamp::SetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetMetafile(hMetafile, uType, uFlags=0)

Sets the metafile for a stamp object.

Parameters

HMETAFILE hMetafile

Handle to a metafile.

L_UINT uType

Constant that indicates the metafile to set. Possible values are:

Value Meaning
ANNMETAFILE_USER [0x7FFF] user-defined metafiles
ANNMETAFILE_APPROVED [0] predefined metafiles - APPROVED
ANNMETAFILE_ASSIGNED [1] predefined metafile - ASSIGNED
ANNMETAFILE_CHECKED [2] predefined metafile -CHECKED
ANNMETAFILE_CLATPRV [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
ANNMETAFILE_COPY [4] predefined metafile - COPY
ANNMETAFILE_EXTENDED [5] predefined metafile - DRAFT
ANNMETAFILE_EXTENDED [6] predefined metafile - EXTENDED
ANNMETAFILE_FAX [7] predefined metafile - FAX
ANNMETAFILE_FAXED [8] predefined metafile - FAXED
ANNMETAFILE_IMPORTANT [9] predefined metafile - IMPORTANT
ANNMETAFILE_INVOICE [10] predefined metafile - INVOICE
ANNMETAFILE_NOTICE [11] predefined metafile - NOTICE
ANNMETAFILE_OFFICIAL [12] predefined metafile - OFFICIAL
ANNMETAFILE_ONFILE [13] predefined metafile - ON FILE
ANNMETAFILE_PAID [14] predefined metafile - PAID
ANNMETAFILE_PASSED [15] predefined metafile - PASSED
ANNMETAFILE_PENDING [16] predefined metafile - PENDING
ANNMETAFILE_PROCESSED [17] predefined metafile - PROCESSED
ANNMETAFILE_RECEIVED [18] predefined metafile - RECEIVED
ANNMETAFILE_REJECTED [19] predefined metafile - REJECTED
ANNMETAFILE_RELEASE [20] predefined metafile - RELEASE
ANNMETAFILE_SENT [21] predefined metafile - SENT
ANNMETAFILE_SHIPPED [22] predefined metafile - SHIPPED
ANNMETAFILE_TOPSECRET [23] predefined metafile - TOP SECRET
ANNMETAFILE_URGENT [24] predefined metafile - URGENT
ANNMETAFILE_VOID [25] predefined metafile - VOID
ANNMETAFILE_ENCRYPTOR [27] predefined metafile for an encrypt object in the encryptor state
ANNMETAFILE_DECRYPTOR [28] predefined metafile for an encrypt object in the decryptorstate

L_UINT uFlags

Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

Value Meaning
0 Process only the specified object.
ANNFLAG_SELECTED [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the LAnnotation::IsSelected and LAnnotation::SetSelected functions.
ANNFLAG_NOTTHIS [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
ANNFLAG_RECURSE [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANNFLAG_NOTCONTAINER [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
ANNFLAG_NOINVALIDATE [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANNFLAG_CHECKMENU [0x0020] Process objects only if the ANNAUTOTEXT_MENU_METAFILE menu item has been selected.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Only stamp objects, hotspot objects, and freehand hotspot objects can have metafiles. Note that for stamps, setting the metafile destroys the stamp objects bitmap and text. Also, setting a bitmap or text destroys the metafile associated with the stamp object. (The stamp object can have Text, Bitmap or Metafile and each of these cancels the other two).

If uType == ANNMETAFILE_USER, then hMetafile is the metafile handle. You can use any of the windows functions to create a metafile.

If uType is one of the ANNMETAFILE_XXX values, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 25 predefined metafiles. You can change the predefined metafiles by using LAnnotation::SetPredefinedMetafile.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example sets the metafile in the stamp annotation to the predefined
metafile ANNMETAFILE_IMPORTANT

L_INT LAnnStamp_SetMetafileExample(HWND hWnd) 
{ 
   LBitmap MyBitmap; 
   RECT rect; 
   ANNRECT annRect; 
   HMETAFILE hNotUsed; 
   LAnnStamp MyAnnStamp; 
 
   annRect.left = 50; 
   annRect.top = 50; 
   annRect.right = 150; 
   annRect.bottom = 150; 
 
   hNotUsed = 0; 
   MyAnnStamp.SetMetafile(hNotUsed, ANNMETAFILE_IMPORTANT, 0); 
 
   MyAnnStamp.SetRect(&annRect); 
   MyAnnStamp.SetVisible(TRUE); 
   MyAnnStamp.GetBoundingRect(&rect) ; 
 
   //Draw the annotation 
   HDC hDC = ::GetDC(hWnd); 
   MyAnnStamp.Draw(hDC,&rect); 
   ::ReleaseDC(hWnd, hDC);  
 
   return SUCCESS; 
} 

Help Version 21.0.2021.4.8
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help