ImageEn, unit hyieutils

TIEDictionary.GetNext

TIEDictionary.GetNext


Declaration

function GetNext(current: TIEStrStrEnumerator): boolean;


Description

Allows to iterate among all dictionary elements.
Returns true if an element is available.

Parameter Description
current An object used to store current enumerator state


Examples

var current: TIEStrStrEnumerator;
current := TIEStrStrEnumerator.Create();
while dict.GetNext(current) do
begin
  key   := current.item.key;
  value := current.item.value;
       ...
end;
current.Free();


// Save a PNG file as a lossless WebP with lossless compression (using ImageMagick plug-in)
var
  imDict: TIEDictionary
begin
  ImageEnView1.IO.SaveToFile('D:\Image.png');
  imDict := TIEDictionary.Create();
  imDict.Insert( 'webp:lossless', true );
  imDict.Insert( 'webp:method', 0 );
  imDict.Insert( 'webp:auto-filter', true );
  ImageEnView1.IO.Params.Dict.Insert( 'ImageMagick', imDict );
  ImageEnView1.IO.SaveToFile('D:\Image_out.webp');
end;

// List items in "ImageMagick" dictionary
var
  dict: TIEDictionary;
  curr: TIEStrStrEnumerator;
  key, val: String;
begin
  dict := TIEDictionary( ImageEnView1.IO.Params.Dict.Get( 'ImageMagick', True, False ));
  if dict = nil then
    exit;

  curr := TIEStrStrEnumerator.Create();
  try
    while dict.GetNext( curr ) do
    begin
      key := curr.item.key;
      val := IEDictValueToStr( curr.item.value );
      Memo1.Lines.Add( key + '=' + val );
    end;
  finally
    curr.Free();
  end;
end;
{
Result:
webp:method=0
webp:lossless=true
webp:auto-filter=true
}