ImageEn, unit iexBitmaps

TIEMarkerList.IndexOf

TIEMarkerList.IndexOf

Declaration

function IndexOf(Marker: Byte): Integer;

Description

Finds the first marker and return its index. If a marker is not in the list, IndexOf returns -1.

Examples

// Read the JPEG_COM marker  (Idx is Integer, Comment is string)
ImageEnView1.IO.LoadFromFile('C:\image.jpg');
Idx := ImageEnView1.IO.Params.JPEG_MarkerList.IndexOf(JPEG_COM);
Comment := ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[Idx];

// Now writes the JPEG_COM marker
Comment := 'This is the new comment';
ImageEnView1.IO.Params.JPEG_MarkerList.SetMarker(Idx, JPEG_COM, PAnsiChar(Comment), Length(Comment));
ImageEnView1.IO.SaveToFile('D:\Image.jpg');