ImageGear for C and C++ on Linux v18.10 - Updated
LPFNIG_ART_PREMODIFYNOTIFYFUNC
API Reference Guide > ART Component API Reference > ART Component Callback Functions Reference > LPFNIG_ART_PREMODIFYNOTIFYFUNC

This function is called whenever a mark attribute is about to be modified (moved, resized, or edited).

Declaration:

 
Copy Code
typedef BOOL (ACCUAPI *LPFNIG_ART_PREMODIFYNOTIFYFUNC)(
        HIGEAR hIGear, 
        LPVOID lpPrivate, 
        ART_MARK_INDEX hMarkIndex, 
        const LPART_MARK_ATTRIBUTES lpMarkAttr, 
        AT_MODE nReason
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of an image.
lpPrivate LPVOID A far pointer to private callback data.
hMarkIndex ART_MARK_INDEX The index number to the mark to be modified.
lpMarkAttr const LPART_MARK_ATTRIBUTES Set to type ART_MARK_ATTRIBUTES that is associated with the mark.
nReason AT_MODE An integer constant of type AT_MODE, defined in ARTAPI.H. This indicates what caused the callback.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Example:

 
Copy Code
BOOL ACCUAPI ARTPreModifyNotify( HIGEAR hIGear, 
LPVOID lpPrivate, ART_MARK_INDEX hMarkIndex, 
const LPART_MARK_ATTRIBUTES lpMarkAttr, 
AT_MODE nReason)
{
switch (nReason)
{
case ART_MODIFY_ATTRIBUTES:
    /* prevent the highlighting attribute from being */ 
 /* enabled */
 if (lpMarkAttr->bHighlighting)
    return FALSE;
}
return TRUE;
}

Remarks:

In order to use this callback, it must be registered with ART using the function ART_callback_register().

If this callback function returns FALSE, the mark does not change. Set it to TRUE to allow the mark to be modified. Upon entry, nReason is set to a constant indicating what triggered the modification. At this point your application can display one of the library's standard editing dialog boxes. "Reasons" this callback is called may be:

ART_MODIFY_ATTRIBUTES One or more attributes have been modified (from the ART_MARK_ATTRIBUTES structure).
ART_MODIFY_ANODAT A named block specific to this type of mark was modified.
ART_MODIFY_FILNAM The filename block was modified.
ART_MODIFY_DIB The embedded DIB was changed.
ART_MODIFY_GROUP The mark's group block was modified.
ART_MODIFY_INDEX The mark's index block was changed.
ART_MODIFY_ANTEXT The orientation or length of text mark was modified.
ART_MODIFY_NAMED_BLOCK A user-defined named block was modified.