This callback function is called after the text mark is resized by mouse dragging and before the mark is repainted.
Declaration:
Copy Code | |
---|---|
typedef AT_BOOL (ACCUAPI *LPFNIG_ART_TEXTOVERFLOWNOTIFYFUNC)(
HIGEAR hIGear,
LPVOID lpPrivate,
ART_MARK_INDEX hMarkIndex,
DWORD dwMarkType,
const LPAT_RECT lprcPreferableBounds,
DWORD dwTextLength,
DWORD dwReserved
);
|
Arguments:
hIGear | HIGEAR handle of an image. |
lpPrivate | A pointer to the private callback data. |
hMarkIndex | The index for the selected mark. |
dwMarkType | The type of selected mark. Currently it can be ART_MARK_TYPED_TEXT, ART_MARK_ATTACH_A_NOTE, ART_MARK_TEXT_FROM_FILE. |
lprcPreferableBounds | Preferable mark bounds to draw whole mark text (cut to clip bounds). |
dwTextLength | The length of overflowed text (the last NULL is not included). If the text is not overflowed must be set to 0. |
dwReserved | Reserved for future use. Currently should be set to 0. |
Return Value:
Returns FALSE for the mark's selection state to remain unchanged; returns TRUE to allow the mark's selection state to change.
Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Annotation
Example:
Copy Code | |
---|---|
HIGEAR hIGear; HWND hWnd; ART_MARK_INDEX markIndexes[3]; /* array of processed mark indexes*/ /* ... */ /* Initialize the markIndexes array anywhere*/ /* and call */ /* ART_callback_register(hIGear,ART_CALLBACK_TEXT_OVERFLOW_NOTIFY, TextOverflowNotify, lpPrivate);*/ /* to register TextOverflowNotify callback function*/ /* ... */ AT_BOOL ACCUAPI TextOverflowNotify( HIGEAR hIGear, LPVOID lpPrivate, ART_MARK_INDEX hMarkIndex, DWORD dwMarkType, const LPAT_RECT lprcPreferedBounds, DWORD dwOverflowedTextLength, DWORD dwReserved ) { AT_ERRCOUNT nErrCount; ART_MARK_ATTRIBUTES ma; AT_RECT rcBounds; DWORD dwTextLength; /* The ART_GUI_text_flow is applied only for ART_MARK_TYPED_TEXT and ART_MARK_ATTACH_A_NOTE */ if ( dwMarkType != ART_MARK_TYPED_TEXT && dwMarkType != ART_MARK_ATTACH_A_NOTE ) return TRUE; if ( hMarkIndex == markIndexes[0] ) { nErrCount = ART_GUI_text_flow(hIGear, IG_GRP_DEFAULT, hWnd, (LPART_MARK_INDEX)markIndexes, 3 ); if ( nErrCount == 0 ) nErrCount = ART_GUI_mark_paint( hIGear, IG_GRP_DEFAULT, markIndexes[1], hWnd, TRUE ); } else if ( hMarkIndex == markIndexes[1] ) { nErrCount = ART_GUI_text_flow( hIGear, 0, hWnd, (LPART_MARK_INDEX)(markIndexes + 1), 2 ); } /* Set preferable bounds to the third mark */ /* If you do not want to change the mark size remove the following code */ if ( hMarkIndex != markIndexes[2] && nErrCount == 0 ) { ART_GUI_mark_paint( hIGear, IG_GRP_DEFAULT, markIndexes[2], hWnd,FALSE ); nErrCount = ART_mark_query( hIGear, markIndexes[2], &ma ); /* Get the preferable bounds for third mark*/ if ( nErrCount == 0 ) nErrCount = ART_GUI_text_overflow_check( hIGear, IG_GRP_DEFAULT, hWnd, markIndexes[2], &rcBounds, &dwTextLength); if ( nErrCount == 0 ) { /*Change the bounds*/ ma.rcBounds = rcBounds; ART_mark_modify( hIGear, markIndexes[2], &ma ); /*Repaint the mark*/ ART_GUI_mark_paint( hIGear, IG_GRP_DEFAULT, markIndexes[2], hWnd, TRUE ); } } return TRUE; } |
Remarks:
This callback function is called independently on whether the text overflows the mark bounds or not. It is applied for ART_MARK_TYPED_TEXT, ART_MARK_ATTACH_A_NOTE and ART_MARK_TEXT_FROM_FILE marks.
The return value is ignored at this time. Using this callback function customer has possibility to change the mark bounds or apply ART_GUI_text_flow() after resizing of the text mark bounds.
In order to use this callback, it must be registered with ART using the function ART_callback_register(). |