本文整理汇总了C#中IEngine.LoadImageDocFromMemory方法的典型用法代码示例。如果您正苦于以下问题:C# IEngine.LoadImageDocFromMemory方法的具体用法?C# IEngine.LoadImageDocFromMemory怎么用?C# IEngine.LoadImageDocFromMemory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEngine
的用法示例。
在下文中一共展示了IEngine.LoadImageDocFromMemory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: How_to_pass_images_between_processes_or_to_and_from_FineReader_Engine
// HOW-TO: How to pass images between processes or to and from FineReader Engine
public static void How_to_pass_images_between_processes_or_to_and_from_FineReader_Engine( IEngine engine )
{
trace( "Prepare an image in FlexiCapture Engine format..." );
IDocument document = PrepareNewRecognizedDocument( engine );
IImageDocument pageImageDocument = document.Pages[0].ReadOnlyImage;
trace( "Serialize the image document in memory..." );
// You are responsible for freeing the allocated memory when it is no longer needed
int hGlobal = pageImageDocument.SaveImageDocToMemory();
try {
// The handle to the serialized image can be used in the same process (for example for
// interoperability with FineReader Engine) or passed (marshalled) to a different process if required
trace( "Deserialize the image document from memory..." );
// To deserialize the image in the target context use LoadImageDocFromMemory method.
// An identical method is present in FineReader Engine which can be used to convert
// images to FREngine format
IImageDocument documentCopy = engine.LoadImageDocFromMemory( hGlobal );
} finally {
// Do not forget to free the memory. The memory can be freed either in the same process where
// it was allocated or in the process where the image is consumed
trace( "Free the memory..." );
Kernel32.GlobalFree( (IntPtr)hGlobal );
}
}