此介面已在 Linux 和 Windows 版 FRE 中實作。
方法
| 名稱 | 說明 |
|---|---|
| GetNextImageDocument | 回傳來源的影像處理佇列中的下一個影像文件。 |
| GetNextImageFile | 回傳來源的影像處理佇列中的下一個影像檔案。 |
| IsEmpty | 檢查來源的影像處理佇列中是否有任何影像檔案。 |
輸入參數
範例
C# 程式碼
C# 程式碼
| 名稱 | 說明 |
|---|---|
| GetNextImageDocument | 回傳來源的影像處理佇列中的下一個影像文件。 |
| GetNextImageFile | 回傳來源的影像處理佇列中的下一個影像檔案。 |
| IsEmpty | 檢查來源的影像處理佇列中是否有任何影像檔案。 |
C# 程式碼
// 自訂影像來源的範例實作,會維護影像檔案佇列
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
{
...
}
這個頁面有幫助嗎?