跳轉到主要內容
此物件提供用於處理影像版面的各種方法和屬性。Layout 物件可作為各個區塊的根物件。其屬性為 width 和 height。這些參數會設為與定義該 Layout 物件之影像黑白頁面的對應參數相同。在分析或識別 Layout 物件時,系統會自動完成此設定。 Layout 物件是持久性物件。這表示可將物件的目前狀態寫入持久性儲存體。之後,可透過從持久性儲存體讀取物件狀態來重新建立該物件。下列方法可用於持久化該物件:

屬性

,唯讀

回傳 Engine 物件。

,唯讀

提供對 layout 中分隔線及分隔線群組區塊集合的存取。

無論 Layout 中是否存在分隔區塊,此屬性均指向有效物件。若 Layout 中沒有分隔線,則 BlackSeparators 屬性為空。

,唯讀

提供對 layout 中區塊集合的存取。此集合不包含分隔線及分隔線群組區塊。若要存取這些區塊,請使用 BlackSeparators 屬性。

無論 Layout 中是否存在任何區塊,此屬性均指向有效物件。若 Layout 中沒有區塊,則 Blocks 屬性為空。另請參閱使用唯讀物件屬性

此集合不會包含自動分析區塊,因為此型別的區塊僅用於 Visual Components。

,唯讀

回傳 layout 中依邏輯順序排列的區塊集合。

此集合包含與 Blocks 屬性所回傳的相同區塊,依各區塊左上角位置排序,先由左至右,再由上至下。位置相近的區塊將被視為同一邏輯群組的一部分。

,唯讀

Visual Components 目前僅支援 Windows。

提供對 Visual Components 中可見區塊集合的存取。此集合可包含以下型別的區塊:文字、表格、點陣圖片、條碼、自動分析。此集合中區塊的排列順序與 Visual Components 中顯示的順序相同。

, 唯讀

回傳 layout 的高度 (以像素為單位) ,等於對應.

儲存 layout 名稱。

, read-only

Writes the text from all text and table blocks to one line. Theobject determines the order in which text from table cells is written. So the order may not coincide with the table cells order as they go in the image. Text of barcode blocks is not written.

,唯讀的

儲存 layout 中各區塊的邊界 Region。若不存在任何區塊,此屬性將回傳空的 Region。

Allows you to associate any user-defined information with an object of the Layout type.

, read-only

Returns the layout width in pixels. It is equal to the width ofof the corresponding.

方法

名稱描述
Clean從版面中移除所有類型的區塊和分隔線。
CopyFrom使用另一個物件中對應屬性的值來初始化目前物件的屬性。
LoadFromFile從磁碟上的檔案還原物件內容。
LoadFromMemory <Note> 僅限 Windows。 </Note>從全域記憶體還原物件內容。
SaveToArray將物件內容儲存為位元組陣列。
SaveToFile將物件內容儲存到磁碟上的檔案中。
SaveToMemory <Note> 僅限 Windows。 </Note>將物件內容儲存到全域記憶體中。
SaveToStream將物件內容儲存到資料流中。

Windows

Layout

Linux 與 macOS

LayoutLinuxMac 物件圖表

輸出參數

此物件是 Engine 物件的 CreateLayoutFromStream 方法之輸出參數。

範例

FREngine.IFRDocument frdoc;
// 逐一走訪版面中的區塊
for (int iPage = 0; iPage < frDoc.Pages.Count; iPage++)
{
 FREngine.IFRPage page = frDoc.Pages[iPage];
 FREngine.ILayout layout = page.Layout;
 int blocksCount = layout.Blocks.Count;
 for (int iBlock = 0; iBlock < blocksCount; iBlock++)
 {
  FREngine.IBlock block = layout.Blocks[iBlock];
  ...
 }
}
此物件用於下列程式碼範例:

另請參閱

使用 Layout 和 Blocks LayoutBlocks 使用屬性