LAnnStamp::SetMetafile

#include "ltwrappr.h"

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

HMETAFILE hMetafile;

/* handle to a metafile */

L_UINT uType;

/* constant that indicates the metafile to set */

L_UINT uFlags;

/* flags that determine which objects to process */

Sets the metafile for a stamp object. This function is available in the Document/Medical Toolkits.

Parameter

Description

hMetafile

Handle to a metafile.

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

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

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

LTANN

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

See Also

Functions:

LAnnStamp::GetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Automated User Interface for Annotations

 

Using Annotation Bitmap Objects

Example

//This example sets the metafile in the stamp annotation to the predfined

//metafile ANNMETAFILE_IMPORTANT

L_INT LAnnStamp_SetMetafileExample(HWND hWnd)
{
   LBitmap MyBitmap;
   RECT rect;
   ANNRECT annRect;
   HMETAFILE hNotUsed;
   LSettings::UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
   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;
}