Available in the LEADTOOLS Imaging toolkit. |
TransformMarker event (Main Control)
Visual
Basic example
Visual
C++ 4.0 example
Syntax void TransformMarker (short iMarker, long lSize, VARIANT vData, short iTransform);
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