חלץ את כל הטקסט
Contents
[
Hide
]איך לחלץ את כל הטקסט
בעיה: איך לחלץ את כל הטקסט.
טיפים: כדי לעשות זאת, אתה יכול להשתמש בשיטת GetStrings, אשר מאפשרת לך לקבל את כל הטקסט.
הערה: אתה יכול לחלץ את כל הטקסט מהשרטוט הבסיסי. להלן דוגמה לחילוץ כל הטקסט. מצורפים תוצאות הפלט מעורך הפקודות (ExtractTextResult.bmp) וקובץ המקור (ExtractText.dwg).
דוגמה:
This file contains hidden or 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); | |
} | |
} |