ImageGear for C and C++ on Windows v19.1 - Updated
LPFNIG_ART_PRECREATENOTIFYFUNC
API Reference Guide > ART Component API Reference > ART Component Callback Functions Reference > LPFNIG_ART_PRECREATENOTIFYFUNC

This callback function is called just before a mark is created.

Declaration:

 
Copy Code
typedef BOOL (ACCUAPI *LPFNIG_ART_PRECREATENOTIFYFUNC)(
        HIGEAR hIGear, 
        LPVOID lpPrivate, 
        ART_MARK_INDEX hMarkIndex, 
        LPART_MARK_ATTRIBUTES lpMarkAttr
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of an image.
lpPrivate LPVOID A far pointer to the private callback data.
hMarkIndex ART_MARK_INDEX The index number (identifier) for the new mark.
lpMarkAttr LPART_MARK_ATTRIBUTES A far pointer to an ART-defined attribute structure of type ART_MARK_ATTRIBUTES. This can be used to override the default mark attributes before the new mark is created.

Return Value:

Returns TRUE - the mark is created; FALSE - the mark is not created.

Supported Raster Image Formats:

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

Sample:

None

Example:

 
Copy Code
BOOL ACCUAPI MyChangeAttributes (        HIGEAR hIGear, 
LPVOID lpPrivate, ART_MARK_INDEX hMarkIndex, LPART_MARK_ATTRIBUTES lpMarkAttr)
{
if (lpMarkAttr.dwType == 6) /* if mark is a filled */
   /* rectangle  */
{
lpMarkAttr.bHighlighting = TRUE;   
/* apply highlighting to the mark */
}
return TRUE;
}

Remarks:

The MarkIndex passed into the callback is the MarkIndex that is used when the mark is created. This callback function gives the developer an opportunity to change any default named blocks or the mark attributes for the mark that is about to be created.

The callback for "Pre create" occurs before the end user draws the mark. For example, if the user draws a line, LPFNIG_ART_PRECREATENOTIFYFUNC is called when the mouse is pressed. If this callback returns TRUE, then the point where the mouse was pressed becomes the first end-point of the line. The point where the user releases the mouse button becomes the second end-point. At this time LPFNIG_ART_CREATENOTIFYFUNC is called.

The return value is either TRUE or FALSE. When set to FALSE, the mark is not created. When set to TRUE, the mark is created.

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