跳转到主要内容
此方法已在适用于 Linux 和 Windows 的 FRE 中实现。
此方法在客户端实现,用于确定源的处理队列中是否包含任何图像文件。

语法

C++

HRESULT IsEmpty( VARIANT_BOOL* Result );

C#

bool IsEmpty();

Visual Basic .NET

Function IsEmpty() As Boolean

参数

Result [out, retval] 此参数指示是否有需要处理的图像文件。如果此参数为 TRUE,则表示没有需要处理的图像。

返回值

[仅限 C++] 如果此方法返回的值不是 S_OK,则表示客户端发生了错误。

备注

此 方法 的客户端实现必须确保在 方法 内部抛出的所有异常都能被捕获并妥善处理,且不会传播到 方法 外部。异常一旦传播到 方法 外部,可能会导致不可预测的结果 (例如程序终止) 。

示例

// 自定义图像源的示例实现,用于维护图像文件队列
public class ImageSourceCallback : FREngine.IImageSource
{
   public ImageSourceCallback( string imageFilesDirectory )
   {
       imageFiles = ImageSourceHelper.LoadFilesNames( imageFilesDirectory );
       nextFileIndex = 0;
   }
   public bool IsEmpty()
   {
       return nextFileIndex >= imageFiles.Length;
   }
   public FREngine.IFileAdapter GetNextImageFile()
   {
       if( !IsEmpty() ) {
           return new FileAdapterCallback( imageFiles[nextFileIndex++] );
       }
       return null;
   }
   public FREngine.IImageDocument GetNextImageDocument()
   {
       ...
   }
   private string[] imageFiles;
   private int nextFileIndex;
}
public class FileAdapterCallback : FREngine.IFileAdapter
{
    ...
}
public class ImageSourceHelper
{
    ...
}

另请参见

IImageSource GetNextImageDocument GetNextImageFile