?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, GDIPAPI, GDIPOBJ, GDIPUTIL, StdCtrls, ComObj;
type
TForm1 = class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
image: TGPImage;
count, frameCount: UINT;
DimensionIDs: PGUID;
strGuid: string;
var i: integer;
type
TGUIDDynArray = array of TGUID;
begin
Image := TGPImage.Create('..\..\..\Media\MultiFrame.tif');
// How many frame dimensions does the Image object have?
count := image.GetFrameDimensionsCount;
memo1.Lines.Add(format('The number of dimensions is %d.', [count]));
GetMem(DimensionIDs, count * SizeOf(TGUID));
// Get the list of frame dimensions from the Image object.
image.GetFrameDimensionsList(DimensionIDs, count);
for i := 0 to count - 1 do
begin
strGuid := GUIDToString(TGUIDDynArray(DimensionIDs)[i]);
memo1.Lines.Add('The first (and only) dimension ID is ' + strGuid);
end;
// Get the number of frames in the first dimension.
frameCount := image.GetFrameCount(TGUIDDynArray(DimensionIDs)[0]);
memo1.Lines.Add('The number of frames in that dimension is '+ inttostr(frameCount));
freemem(DimensionIDs);
image.Free;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -