以倚天16x15字型作為翻譯基準輸入中英文字(不包含特殊符號,基本ASCII可以使用),翻譯成每個字每個字的16x15 Byte 圖形
如有字幕機可搭配註解區段使用
for (i = 0; i < srvch.Length; i ) { oneltr = srvch[i].ToString(); if (Encoding.GetEncoding(950).GetByteCount(oneltr) < 2) { tmp = Encoding.ASCII.GetBytes(oneltr); hi = tmp[0]; offset = hi * 15; for (j = i * 34, h = 0; h < 34; h = 2, j = 2) { if (h < 30) { tx[j] = ascf[offset]; } else if (h >= 30 && h < 32) tx[j] = 0x00; else if (h == 32 && i != srvch.Length - 1) { tx[j] = 0x94; tx[j 1] = 0xd0; } offset ; } } else { tmp = Encoding.GetEncoding(950).GetBytes(oneltr); hi = tmp[0]; lo = tmp[1]; if (lo >= 161) sercode = (hi - 161) * 157 (lo - 161) 1 63; else sercode = (hi - 161) * 157 (lo - 64) 1; if (sercode >= 472 && sercode <= 5872) offset = (sercode - 472) * 30; else if (sercode >= 6281 && sercode <= 13973) offset = (sercode - 6281) * 30 162030; for (j = i * 34, h = 0; h < 34; j , h ) { if (h < 30) { if (offset > 3) { tx[j] = stdf[offset - 2]; } else { tx[j] = stdf[offset]; } } else if (h < 32) tx[j] = 0x00; else if (h == 32 && i != srvch.Length - 1) tx[j] = 0x94; else if (h == 33 && i != srvch.Length - 1) tx[j] = 0xd0; offset ; } } }
评论