OnTransformMarker event (Main Control)
Builder Syntax |
TTransformMarkerEvent OnTransformMarker (int iMarker, int lSize, void * pData, int iTransform); |
Delphi Syntax |
OnTransformMarker (iMarker: Integer; lSize: Longint; pData: Pointer; iTransform: Integer): TtransformMarkerEvent |
Overview |
Refer to Examining and Altering Bitmaps |
Remarks
This event is fired for every JPEG marker present in the file transformed by the TransformFile method.
Processing this event is not required. It is recommended that you have a good knowledge of JPEG files before processing this event. Incorrect handling of the markers can create corrupted files.
Typically, this event could be used to process user-defined markers (APP0 – APP14). These markers may contain extra information like stamps, file resolution information, etc.
This can also be used to prevent certain markers from being written if the file. For more information, refer to the WriteMarkerAction property.
Upon returning from this event, LEADTOOLS will examine the value of the WriteMarkerAction property to see if the default processing should be performed for this marker. If the WriteMarkerAction property is:
WRITEMARKER_DEFAULT, then LEADTOOLS will perform the default action and write it to the file.
WRITEMARKER_IGNORE, then LEADTOOLS will not write this marker to the file.
WRITEMARKER_ABORT, then the file transformation process is aborted and the TransformFile method will return ERROR_USER_ABORT.
When transforming the marker data, call the WriteMarker method with the WriteMarkerAction property set to WRITEMARKER_IGNORE. That way the marker will not occur twice in the file.
See Also
Elements: |
TransformFile method, WriteMarker method, WriteMarkerAction property |
Topics: |