示例#1
0
        private bool CheckFrom(List<str_Char> chars, int iIndex, string sWord, str_PointResult ptPoint) {
            for (int i = iIndex, i1 = 1; i < chars.Count; i++, i1++) {
                Point ptMid = CGraphics.GetMiddle(chars[i].ptLocation.ptBegin,
                    chars[i].ptLocation.ptEnd);

                if (chars[i].sChar == sWord[i1 - 1]
                    && ((ptMid.Y > ptPoint.ptBegin.Y) && (ptMid.Y < ptPoint.ptEnd.Y))) {
                    return true;
                }
            }
            return true;
        }
示例#2
0
        public CWord(List<str_Char> _chars) {
            this.sWord = "";
            this.chars = _chars;

            for (int i = 0; i < chars.Count; i++) {
                sWord += chars[i].sChar;
            }

            if (chars.Count > 0) {
                this.prLocation = chars[0].ptLocation;
            }
        }
示例#3
0
        private bool LinkWord(Bitmap bmpSource, Color cTextColor, string sWord, str_PointResult baseChar,
            KeyValuePair<List<str_PointResult>, List<str_Char>> kpResults) {
            Bitmap bmpNew = CGraphics.SliceBitmap(bmpSource,
                new Rectangle(baseChar.ptBegin.X, baseChar.ptBegin.Y - 2,
                    bmpSource.Width - baseChar.ptBegin.X, (baseChar.ptEnd.Y - baseChar.ptBegin.Y) + 10));

            for (int i = 0; i < kpResults.Value.Count; i++) {
                if (kpResults.Value[i].sChar == sWord[0]) {
                    if (!CheckFrom(kpResults.Value, i, sWord, kpResults.Value[i].ptLocation)) {
                        return false;
                    }
                }
            }

            return true;
        }