📄 index.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Optical Character Recognition Example</title><link href="style.css" rel="stylesheet" type="text/css"></head><table border="0" width="100%" height="8" bgcolor="#eeeeee"><tr> <td width="100%" height="1"><b><font size="2" color="#000000" face="Arial, Helvetica, sans-serif"><strong><a name=Top></a>S60 5th Edition SDK v0.9 </strong></font></b><br><i>Example Applications Guide</i></td></tr> </table><!-- Generated by Doxygen 1.4.5 --><div class="tabs"> <ul> <li id="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul></div><h1>Optical Character Recognition Example</h1><p><a class="el" href="index.html#Intro_sec">1. About this Example</a> <br><a class="el" href="index.html#Arch_sec">2. Architecture</a> <br><a class="el" href="index.html#Design_sec">3. Design and Implementation</a><p><hr><h2><a class="anchor" name="Intro_sec">1. About this Example</a></h2>This example demonstrates, how to use Optical Character Recognition API (henceforth OCR) introduced in S60 3rd edition Feature Pack 1.<p><dl compact><dt><b>Note:</b></dt><dd>Optical Character Recognition feature does not exist in all devices. OCR Example cannot be executed in such devices.</dd></dl><h3><a class="anchor" name="Sub11">1.1 APIs demonstrated</a></h3><ul><li>OCR API</li><li>CImageDecoder</li><li>CBitmapScaler</li><li>CAknSettingItemList</li><li>CEikGlobalTextEditor</li><li>CAknForm</li></ul><p><hr><h3><a class="anchor" name="Sub12">1.2 Prerequisites</a></h3>It is recommended that the reader first familiarizes herself with OCR API usage in SDK help.<p>Additionally the example makes use of several other Symbian and S60 features of which the reader should be aware of:<ul><li>Window graphics context</li><li>Bitmaps</li><li>File Server session</li><li>Active Objects</li><li>Forms and Settings list</li></ul><p><hr><h2><a class="anchor" name="Arch_sec">2. Architecture</a></h2>OCR Example application design follows Avkon View-switching architecture.<h2><a class="anchor" name="Design_sec">3. Design and Implementation</a></h2>OCR Example consists of three views:<ul><li>the main-view i.e. image-view shows loaded image in the screen. OCR operations are executed in this view.</li><li>one sub-view i.e. settings-view shows general settings of application, such as which languages are used in recognition.</li><li>one sub-view i.e. text-view shows the result of analysis and recognition.</li></ul><p>The logic of application is somewhat heavily concentrated in the <a class="el" href="class_c_ocr_example_image_view.html">COcrExampleImageView</a> class, which controls all the image-related operations (loading and scaling the image, OCR operations and so on). And if you are interested just to see, how OCR operations are done, then that class contains basically everything you need to check.<h3><a class="anchor" name="Sub31">3.1 Capabilities</a></h3>OCR Example does not require any capabilities. The capabilities are defined as NONE in mmp-file.<h3><a class="anchor" name="Sub32">3.2 Start-up</a></h3>When OCR Example application is started, the framework completes the construction of the application by calling <a class="el" href="class_c_ocr_example_app_ui.html#9ce34ba0b947863222da3c63d0481044">COcrExampleAppUi::ConstructL()</a> during which three view-objects are created:<ul><li>image view (<a class="el" href="class_c_ocr_example_image_view.html#301a5b741381c9ed497a7d8f7f10f782">COcrExampleImageView::NewL</a>)</li><li>settings view (<a class="el" href="class_n_o_c_r_utils_1_1_c_simple_view.html#f82712d9bbd47a3fbb8579fff98069d8">NOCRUtils::CSimpleView<>::NewL</a>), and</li><li>text view (<a class="el" href="class_n_o_c_r_utils_1_1_c_simple_view.html#f82712d9bbd47a3fbb8579fff98069d8">NOCRUtils::CSimpleView<>::NewL</a>).</li></ul><p><a class="el" href="class_c_ocr_example_app_ui.html">COcrExampleAppUi</a> has two data-objects as members: <a class="el" href="class_c_ocr_example_app_ui.html#30d9af36f960ced9d66f76546ff72dc2">iSettingsData </a> and <a class="el" href="class_c_ocr_example_app_ui.html#1f042a3778633150ee122bad7a8e17e2">iTextData </a>. Settings-data is used both by image and settings view; text-data is used only by text-view. The data-object is passed to view in their construction.<p><a class="el" href="class_c_ocr_example_image_view.html#301a5b741381c9ed497a7d8f7f10f782">COcrExampleImageView::NewL()</a> for its part creates by calling <a class="el" href="class_c_ocr_example_image_container.html#8a8ff0f1fb84e569111f037935ee6813">COcrExampleImageContainer::NewL()</a> to which settings data is also passed in addition to the <a class="el" href="class_t_screen_update_data.html">TScreenUpdateData</a> data-object via which the image-view controls bitmaps and rectangles drawn to the screen. Image container does not contain much intelligence: essentially it just draws the screen based on data in <a class="el" href="class_t_screen_update_data.html">TScreenUpdateData</a>.<p>The image-view during its <a class="el" href="class_c_ocr_example_image_view.html#9ce34ba0b947863222da3c63d0481044">ConstructL </a> also creates<ul><li>a log-file, where recognition results are written (\Data\OCRExample.txt), and</li><li>two bitmap-files: one for the image to be loaded and another for a re-sized variant of it to fit to the screen; and</li><li>an utility object to handle image loading and scaling is created with <a class="el" href="class_n_o_c_r_utils_1_1_c_image_handler.html#2313eabc359b0dee4c27ae32dec4dec4">NOCRUtils::CImageHandler::NewL</a>.</li></ul><p>Settings and text views are constructed with the help of template class <a class="el" href="class_n_o_c_r_utils_1_1_c_simple_view.html">CSimpleView </a>. Template parameters for the class are container-class and data type to be passed to container in its creation. <br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -