استخراج كل النص
Contents
[
Hide
]كيفية استخراج كل النص
المشكلة: كيفية استخراج كل النص.
نصائح: للقيام بذلك، يمكنك استخدام طريقة GetStrings، التي تتيح لك الحصول على النص الكامل.
ملاحظة: يمكنك استخراج كل النص من الرسم الأساسي. فيما يلي مثال لاستخراج كل النص. مرفق نتائج مخرجات وحدة التحكم (ExtractTextResult.bmp) والملف المصدر (ExtractText.dwg).
مثال:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string fileName = "ExtractText"; | |
string file = string.Format("{0}.dwg", fileName); | |
using (FileStream inStream = new FileStream(file, FileMode.Open)) | |
using (CadImage image = (CadImage)Image.Load(inStream)) | |
{ | |
foreach (string s in image.GetStrings()) | |
{ | |
Console.WriteLine(s); | |
} | |
} |