Learn more about GDI + [102]: tgpimage (22)-Get detailed information of all decoders

Source: Internet
Author: User
Running result of this example:
Clsid: {557CF400-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CAB-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in BMP CodecDllName: FormatDescription: BMPFilenameExtension: *.BMP;*.DIB;*.RLEMimeType: image/bmpFlags: 65543Version: 1SigCount: 1SigSize: 2Clsid: {557CF401-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CAE-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in JPEG CodecDllName: FormatDescription: JPEGFilenameExtension: *.JPG;*.JPEG;*.JPE;*.JFIFMimeType: image/jpegFlags: 65543Version: 1SigCount: 1SigSize: 2Clsid: {557CF402-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CB0-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in GIF CodecDllName: FormatDescription: GIFFilenameExtension: *.GIFMimeType: image/gifFlags: 65543Version: 1SigCount: 2SigSize: 6Clsid: {557CF403-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CAC-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in EMF CodecDllName: FormatDescription: EMFFilenameExtension: *.EMFMimeType: image/x-emfFlags: 65542Version: 1SigCount: 1SigSize: 44Clsid: {557CF404-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CAD-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in WMF CodecDllName: FormatDescription: WMFFilenameExtension: *.WMFMimeType: image/x-wmfFlags: 65542Version: 1SigCount: 1SigSize: 4Clsid: {557CF405-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CB1-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in TIFF CodecDllName: FormatDescription: TIFFFilenameExtension: *.TIF;*.TIFFMimeType: image/tiffFlags: 65543Version: 1SigCount: 2SigSize: 2Clsid: {557CF406-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CAF-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in PNG CodecDllName: FormatDescription: PNGFilenameExtension: *.PNGMimeType: image/pngFlags: 65543Version: 1SigCount: 1SigSize: 8Clsid: {557CF407-1A04-11D3-9A73-0000F81EF32E}FormatID: {B96B3CB5-0728-11D3-9D7B-0000F81EF32E}CodecName: Built-in ICO CodecDllName: FormatDescription: ICOFilenameExtension: *.ICOMimeType: image/x-iconFlags: 65542Version: 1SigCount: 1SigSize: 4
 

Code file:

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 TForm1.FormCreate(Sender: TObject);begin  Memo1.Align := alLeft;  Memo1.ScrollBars := ssBoth;end;procedure TForm1.Button1Click(Sender: TObject);var  num, size: Cardinal;  ImageCodecInfo: PImageCodecInfo;  i: Integer;type  ArrImgCodInfo = array of TImageCodecInfo;begin  GetImageDecodersSize(num, size);  GetMem(ImageCodecInfo, size);  GetImageDecoders(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;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 // obtain or set 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.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.