Running result of this example:
CLSID: {557cf400-1a04-11d3-9a73-450f81ef32e} formatid: {B96B3CAB-0728-11D3-9D7B-0000F81EF32E} codecname: Built-in BMP codecdllname: formatdescription: BMP filenameextension :*. BMP ;*. diB ;*. rlemimetype: image/BMP flags: 65543 version: 1 sigcount: 1 sigsize: 2 CLSID: {signature} formatid: {B96B3CAE-0728-11D3-9D7B-0000F81EF32E} codecname: Built-in JPEG codecdllname: formatdescription: Must filenameextension :*. JPG ;*. JPEG ;*. jpe ;*. jfifmimetype: image/container flags: 65543 version: 1 sigcount: 1 sigsize: 2 CLSID: {container} formatid: {B96B3CB0-0728-11D3-9D7B-0000F81EF32E} codecname: Built-in GIF codecdllname: formatdescription: giffilenameextension :*. gifmimetype: image/gifflags: 65543 version: 1 sigcount: 2 sigsize: 6 CLSID: {signature} formatid: {B96B3CB1-0728-11D3-9D7B-0000F81EF32E} codecname: Built-in TIFF codecdllname: formatdescription: Must filenameextension :*. TIF ;*. invalid mimetype: image/container flags: 65543 version: 1 sigcount: 2 sigsize: 2 CLSID: {signature} formatid: {B96B3CAF-0728-11D3-9D7B-0000F81EF32E} codecname: Built-in PNG codecdllname: formatdescription: pngfilenameextension :*. pngmimetype: image/pngflags: 65543 version: 1 sigcount: 1 sigsize: 8
CodeFile:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) memo1: tmemo; button1: tbutton; procedure formcreate (Sender: tobject); Procedure button1click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} uses gdipobj, gdipapi; Procedure upload (Sender: tobject); begin memo1.align: = alleft; cursor: = ssboth; end; Procedure tform1.button1click (Sender: tobject); var num, size: Cardinal; imagecodecinfo: pimagecodecinfo; I: integer; Type arrimgcodinfo = array of timagecodecinfo; begin values (Num, size); getmem (imagecodecinfo, size); num, size, imagecodecinfo); memo1.clear; for I: = 0 to num-1 do with memo1.lines do begin add (format ('clsid: % s', [guidtostring (arrimgcodinfo (imagecodecinfo) [I]. CLSID)]); add (format ('formatid: % s', [guidtostring (arrimgcodinfo (imagecodecinfo) [I]. formatid)]); add (format ('codecname: % s', [arrimgcodinfo (imagecodecinfo) [I]. codecname]); add (format ('dllname: % s', [arrimgcodinfo (imagecodecinfo) [I]. dllname]); add (format ('formatdescription: % s', [arrimgcodinfo (imagecodecinfo) [I]. formatdescription]); add (format ('filenameextension: % s', [arrimgcodinfo (imagecodecinfo) [I]. filenameextension]); add (format ('mimetype: % s', [arrimgcodinfo (imagecodecinfo) [I]. mimetype]); add (format ('flags: % d', [arrimgcodinfo (imagecodecinfo) [I]. flags]); add (format ('version: % d', [arrimgcodinfo (imagecodecinfo) [I]. version]); add (format ('sigcount: % d', [arrimgcodinfo (imagecodecinfo) [I]. sigcount]); add (format ('sigsize: % d', [arrimgcodinfo (imagecodecinfo) [I]. sigsize]); add (''); end; freemem (imagecodecinfo); end.
Form file:
Object form1: tform1 left = 0 Top = 0 caption = 'form1' clientheight = 206 clientwidth = 445 color = clbtnface font. charset = default_charset font. color = clwindowtext font. height =-11 font. name = 'tahoma 'font. style = [] oldcreateorder = false oncreate = formcreate pixelsperinch = 96 textheight = 13 object memo1: tmemo left = 8 Top = 8 width = 337 Height = 145 lines. strings = ('memo1') taborder = 0 end object button1: tbutton left = 351 Top = 32 width = 75 Height = 25 caption = 'button1' taborder = 1 onclick = button1click endend
CLSID // gets or sets the guid structure, which contains the guid that can recognize a specific decoder. Formatid // obtain or set the guid structure, which contains the guid used to identify the decoder format. Codecname // obtain or set a string containing the decoder name. Dllname // obtain or set the path name string containing the DLL that stores the decoder. If the decoder is not in the DLL, the pointer is null. Formatdescription // gets or sets a string that describes the file format of the decoder. Filenameextension // gets or sets a string that contains the file extension used in the decoder. These extensions are separated by semicolons. Mimetype // gets or sets a multi-purpose Internet Mail extended protocol (MIME) string containing the decoder. Flags // gets or sets the 32-bit value used to store other information about the decoder. This attribute returns a combination of several flags from the imagecodecflags enumeration. Version // obtain or set the version number of the decoder. Sigmask // gets or sets a two-dimensional byte array that can be used as a filter. Sigpattern // obtain or set a two-dimensional byte array that represents the decoder signature.