-
-
Save selvypen/7e2f0ab3f3b73e235306589ad2c98328 to your computer and use it in GitHub Desktop.
Simple example source of handwriting recognition for Windows using C#
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
/*! | |
* @brief example source of handwriting recognition | |
* @date 2019/12/10 | |
* @file HandwritingSimpleExample.cs | |
* @author SELVAS AI | |
* | |
* Copyright 2019. SELVAS AI Inc. All Rights Reserved. | |
*/ | |
using System; | |
using Selvasai; | |
namespace HwrExample | |
{ | |
class Program | |
{ | |
// points of 'a' | |
// -1, 0 : end of stroke | |
// -1, -1 : end of ink | |
// (x0, y0), (x1, y1), ... (-1, 0) ... (xn, yn) .... (-1, 0), (-1, -1) | |
static int[] ink_a = {271, 97, 270, 95, 266, 94, 262, 94, 256, 94, 249, 94, 243, 96, 234, 100, 226, | |
107, 216, 118, 208, 127, 203, 137, 195, 147, 191, 156, 188, 163, 188, 169, 188, 172, 191, 175, | |
195, 176, 202, 176, 210, 176, 218, 176, 227, 173, 237, 170, 246, 166, 253, 161, 258, 156, 261, | |
153, 264, 148, 265, 144, 267, 139, 267, 135, 268, 131, 268, 128, 268, 123, 268, 122, 268, 120, | |
268, 117, 268, 116, 268, 119, 273, 126, 278, 133, 284, 140, 291, 145, 294, 150, 299, 153, 301, | |
156, 303, 159, 306, 160, 307, 163, 308, 163, -1, 0, -1, -1 | |
}; | |
// points of 'good morning' | |
static int[] ink_good_morning = {242, 382, 233, 372, 209, 385, 176, 425, 174, 438, 195, 447, 216, | |
427, 223, 411, 231, 379, 233, 382, 233, 405, 234, 456, 232, 512, 227, 534, 200, 569, 167, 569, 154, | |
543, 161, 513, 173, 500, 220, 476, 266, 464, 278, 458, 282, 458, -1, 0, 303, 398, 292, 403, 285, | |
426, 307, 437, 319, 430, 330, 397, 311, 385, 291, 391, 297, 401, -1, 0, 369, 383, 363, 386, 358, | |
415, 385, 421, 411, 402, 418, 388, 406, 370, 372, 380, 362, 402, 368, 406, -1, 0, 496, 385, 497, | |
384, 495, 377, 471, 383, 457, 391, 438, 418, 463, 424, 482, 416, 510, 386, 516, 343, 511, 315, | |
508, 302, 510, 306, 513, 336, 518, 384, 528, 419, 534, 425, 533, 419, -1, 0, 626, 365, 629, 370, | |
633, 392, 635, 405, 634, 421, 630, 420, 638, 389, 644, 378, 658, 371, 671, 393, 673, 412, 673, 416, | |
673, 409, 678, 389, 684, 378, 704, 366, 715, 377, 720, 397, 723, 409, 723, 411, 725, 409, 730, 402, | |
-1, 0, 756, 374, 750, 375, 749, 401, 776, 400, 788, 391, 797, 373, 766, 366, 750, 373, 763, 375, | |
-1, 0, 814, 350, 814, 347, 823, 358, 836, 390, 838, 406, 835, 409, 833, 397, 837, 389, 855, 368, | |
875, 356, 894, 354, 900, 355, 899, 365, -1, 0, 911, 342, 917, 357, 916, 370, 918, 398, 917, 401, | |
917, 384, 929, 351, 946, 341, 955, 354, 958, 366, 961, 389, 964, 401, 959, 380, -1, 0, 983, 327, | |
991, 326, 1005, 330, 1005, 338, -1, 0, 991, 362, 992, 366, 999, 393, 1001, 400, -1, 0, 1032, 344, | |
1039, 350, 1045, 376, 1046, 396, 1049, 388, 1053, 378, 1067, 355, 1079, 352, 1086, 374, 1092, 398, | |
1095, 404, 1097, 403, 1099, 398, -1, 0, 1146, 345, 1149, 350, 1140, 356, 1127, 375, 1142, 384, | |
1160, 359, 1155, 342, 1151, 343, 1164, 366, 1180, 403, 1181, 439, 1176, 457, 1153, 486, 1113, 488, | |
1089, 463, 1101, 443, 1116, 434, 1162, 417, 1219, 409, 1229, 416, 1228, 417, -1, 0, -1, -1 | |
}; | |
// points of '4' | |
static int[] ink_4 = {273, 69, 270, 72, 267, 78, 261, 88, 253, 103, 245, 115, 236, 127, 231, 137, 227, | |
144, 226, 146, 230, 146, 238, 146, 252, 146, 271, 145, 291, 143, 313, 141, 329, 139, 341, 137, | |
352, 137, 358, 137, 362, 137, 364, 136, -1, 0, 300, 105, 300, 106, 300, 112, 298, 121, 298, 132, | |
296, 143, 296, 154, 296, 163, 296, 169, 296, 177, 296, 181, 295, 186, 295, 189, 295, 190, -1, 0, | |
-1, -1 | |
}; | |
// points of '์๋ ํ์ธ์' | |
static int[] ink_annyeonghaseyo = {182, 315, 185, 316, 183, 316, 182, 318, 180, 320, 173, 330, 159, | |
356, 149, 384, 149, 406, 157, 426, 175, 440, 200, 451, 230, 446, 250, 431, 259, 411, 268, 384, | |
266, 357, 258, 341, 244, 330, 229, 327, 215, 326, 204, 328, 195, 332, 192, 339, -1, 0, 357, | |
269, 355, 268, 355, 271, 354, 281, 355, 317, 359, 360, 363, 403, 365, 430, 364, 443, 362, 443, | |
-1, 0, 363, 377, 368, 370, 371, 370, 381, 370, 400, 371, 424, 376, 431, 377, -1, 0, 275, 502, | |
270, 504, 268, 508, 267, 515, 268, 527, 272, 541, 281, 556, 299, 571, 324, 575, 357, 569, 387, | |
555, 408, 533, -1, 0, 506, 301, 498, 296, 497, 302, 492, 327, 484, 364, 479, 401, 478, 432, | |
482, 453, 489, 467, 502, 470, 518, 471, 551, 468, 571, 454, 574, 450, -1, 0, 552, 334, 554, | |
319, 559, 323, 574, 320, 604, 317, 635, 315, 650, 316, 659, 320, 656, 322, -1, 0, 591, 377, | |
589, 377, 598, 375, 622, 371, 650, 363, 678, 353, 683, 348, -1, 0, 701, 300, 698, 300, 697, | |
301, 696, 307, 694, 318, 692, 347, 688, 378, 682, 412, 678, 442, 678, 449, -1, 0, 621, 515, | |
606, 520, 603, 526, 600, 536, 602, 546, 616, 558, 649, 562, 674, 556, 682, 546, 679, 538, 666, | |
531, 621, 518, 594, 526, -1, 0, 790, 282, 789, 278, 789, 279, 790, 282, 799, 288, 829, 304, | |
854, 318, 871, 330, 872, 331, -1, 0, 793, 386, 787, 383, 786, 383, 785, 384, 792, 384, 827, | |
385, 861, 385, 878, 387, -1, 0, 828, 436, 807, 448, 796, 457, 783, 471, 777, 487, 778, 501, | |
790, 506, 825, 507, 847, 496, 851, 487, 850, 477, 844, 471, 830, 465, 804, 460, 792, 459, -1, | |
0, 937, 294, 936, 290, 935, 292, 933, 298, 931, 315, 930, 359, 931, 407, 935, 453, 939, 488, | |
942, 518, 942, 536, 939, 550, 936, 554, -1, 0, 939, 408, 946, 399, 947, 402, 967, 401, 997, | |
402, 1013, 405, -1, 0, 1145, 319, 1134, 315, 1135, 318, 1129, 326, 1105, 362, 1080, 403, 1058, | |
446, 1041, 476, 1030, 496, 1030, 494, -1, 0, 1069, 430, 1071, 425, 1073, 427, 1079, 433, 1092, | |
449, 1106, 471, 1114, 486, -1, 0, 1106, 416, 1104, 404, 1116, 407, 1146, 403, 1179, 399, 1206, | |
391, 1209, 389, -1, 0, 1228, 352, 1225, 357, 1224, 361, 1222, 374, 1222, 404, 1223, 431, 1226, | |
452, 1226, 466, 1225, 463, -1, 0, 1269, 345, 1268, 343, 1267, 347, 1265, 360, 1265, 398, 1267, | |
434, 1269, 466, 1272, 484, 1276, 490, -1, 0, 1373, 342, 1369, 342, 1368, 345, 1368, 354, 1372, | |
366, 1382, 376, 1404, 385, 1431, 377, 1445, 360, 1451, 334, 1446, 321, 1432, 321, 1400, 326, | |
1369, 341, 1358, 359, 1353, 380, 1357, 402, 1363, 421, 1370, 440, 1376, 459, 1377, 479, 1374, | |
497, 1369, 509, 1363, 516, 1361, 514, -1, 0, 1426, 413, 1432, 407, 1432, 408, 1434, 416, 1429, | |
442, 1413, 476, 1388, 503, 1358, 526, 1334, 534, 1319, 536, 1318, 533, 1342, 523, 1417, 503, | |
1477, 495, 1525, 497, -1, 0, -1, -1 | |
}; | |
// points of 'ไธๆตท' | |
static int[] ink_shanghai = {487, 526, 487, 528, 498, 526, 529, 527, 584, 517, 608, 506, 603, 501, 589, | |
498, -1, 0, 484, 421, 479, 420, 470, 424, 469, 464, 479, 529, 483, 571, 482, 589, 474, 618, -1, 0, | |
387, 630, 370, 628, 378, 633, 406, 634, 449, 630, 479, 628, 553, 623, 594, 621, 612, 624, 614, 623, | |
-1, 0, 783, 389, 784, 389, 787, 384, 799, 387, 809, 405, -1, 0, 751, 459, 749, 465, 768, 471, 777, | |
474, -1, 0, 739, 699, 740, 686, 763, 636, 790, 605, 810, 583, 820, 569, -1, 0, 933, 352, 934, 352, | |
932, 385, 918, 433, 910, 452, -1, 0, 920, 420, 925, 415, 966, 416, 1028, 412, 1092, 406, 1109, 405, | |
1118, 412, -1, 0, 964, 470, 955, 466, 943, 485, 927, 527, 914, 566, 904, 596, 903, 609, 919, 628, | |
967, 636, 1016, 637, 1048, 636, 1054, 635, 1044, 625, -1, 0, 939, 487, 939, 485, 961, 472, 993, 476, | |
1020, 486, 1033, 515, 1030, 533, 1008, 596, 986, 646, 969, 683, 959, 696, 957, 682, -1, 0, 855, 556, | |
849, 551, 861, 554, 901, 554, 981, 551, 1043, 548, 1079, 547, 1087, 547, 1085, 548, 1075, 548, -1, 0, | |
961, 512, 955, 510, 957, 513, 962, 519, 962, 523, -1, 0, 960, 583, 965, 589, 973, 595, 978, 596, -1, | |
0, -1, -1 | |
}; | |
// points of 'ใใใใจใ' | |
static int[] ink_arigatou = {272, 331, 265, 338, 311, 340, 400, 328, 455, 306, 470, 282, -1, 0, 354, | |
236, 342, 243, 342, 305, 357, 394, 374, 462, 386, 499, 384, 479, -1, 0, 444, 350, 435, 388, 416, | |
412, 349, 454, 299, 459, 278, 439, 325, 391, 411, 373, 457, 392, 456, 452, 451, 463, 455, 454, -1, | |
0, 569, 310, 570, 327, 571, 365, 570, 380, 569, 370, -1, 0, 619, 280, 620, 280, 632, 309, 639, 357, | |
638, 386, 620, 447, 591, 505, 585, 516, 596, 489, -1, 0, 706, 315, 705, 310, 735, 308, 794, 308, | |
827, 327, 826, 388, 808, 437, 790, 459, 785, 441, -1, 0, 816, 251, 803, 248, 772, 302, 739, 364, | |
723, 426, 723, 468, 740, 450, 747, 441, -1, 0, 839, 294, 851, 303, 859, 330, 861, 344, 858, 338, | |
-1, 0, 869, 235, 874, 240, 876, 249, 878, 263, 872, 259, -1, 0, 887, 223, 892, 227, 902, 249, 906, | |
264, -1, 0, 970, 266, 979, 288, 994, 314, 1015, 320, -1, 0, 1075, 272, 1078, 276, 1021, 338, 962, | |
391, 940, 432, 946, 458, 971, 482, 1029, 487, 1069, 475, 1090, 463, -1, 0, 1181, 234, 1223, 256, | |
1237, 262, 1249, 270, -1, 0, 1151, 336, 1146, 340, 1193, 320, 1246, 320, 1285, 337, 1290, 387, | |
1246, 448, 1203, 494, 1204, 486, -1, 0, -1, -1 | |
}; | |
static int MAX_CANDIDATES = 10; | |
static IntPtr inkObj = IntPtr.Zero; | |
static IntPtr settingObj = IntPtr.Zero; | |
static IntPtr resultObj = IntPtr.Zero; | |
static void MakeInputEvent(IntPtr ink, int[] inputs) | |
{ | |
Hwr.InkClear(ink); | |
int i = 0; | |
while (true) | |
{ | |
if (inputs[i + 0] == -1 && inputs[i + 1] == -1) // if end of ink | |
{ | |
break; | |
} | |
else if (inputs[i + 0] == -1 && inputs[i + 1] == 0) // if end of stroke | |
{ | |
Hwr.EndStroke(ink); | |
} | |
else | |
{ | |
Hwr.AddPoint(ink, inputs[i + 0], inputs[i + 1]); | |
} | |
i += 2; | |
} | |
} | |
static String getCandidates(IntPtr result) | |
{ | |
String output = ""; | |
bool exit = false; | |
int length = 0; | |
int lineSize = Hwr.GetLineSize(result); | |
if (lineSize == 0) | |
{ | |
output = "result empty"; | |
return output; | |
} | |
for (int i = 0; i < MAX_CANDIDATES; i++) | |
{ | |
for (int j = 0; j < lineSize; j++) | |
{ | |
IntPtr line = Hwr.GetLine(result, j); | |
int blockSize = Hwr.GetBlockSize(line); | |
for (int k = 0; k < blockSize; k++) | |
{ | |
IntPtr block = Hwr.GetBlock(line, k); | |
if (Hwr.GetCandidateSize(block) <= i) | |
{ | |
exit = true; | |
break; | |
} | |
output += "[" + (i + 1) + "] "; | |
output += Hwr.GetCandidate(block, i, ref length); | |
if (k + 1 < blockSize) | |
{ | |
output += " "; | |
} | |
} | |
if (exit) | |
{ | |
break; | |
} | |
if (j + 1 < lineSize) | |
{ | |
output += "\n"; | |
} | |
} | |
if (exit) | |
{ | |
break; | |
} | |
output += "\n"; | |
} | |
return output; | |
} | |
static void PrintResult(String title, int status) | |
{ | |
if (status == Hwr.ERR_SUCCESS) | |
{ | |
Console.WriteLine("{0} ...Success", title); | |
Console.WriteLine("Recognized Text: \n{0}", getCandidates(resultObj)); | |
} | |
else | |
{ | |
Console.WriteLine("{0} ...Failed ({1})", title, status); | |
} | |
} | |
static void TestKorean() | |
{ | |
Hwr.ClearLanguage(settingObj); | |
Hwr.AddLanguage(settingObj, Hwr.DLANG_KOREAN, Hwr.DTYPE_KOREAN); | |
Hwr.SetAttribute(settingObj); | |
MakeInputEvent(inkObj, ink_annyeonghaseyo); | |
int status = Hwr.Recognize(inkObj, resultObj); | |
PrintResult("Korean Test", status); | |
} | |
static void TestEnglish() | |
{ | |
Hwr.ClearLanguage(settingObj); | |
Hwr.AddLanguage(settingObj, Hwr.DLANG_ENGLISH, Hwr.DTYPE_UPPERCASE | Hwr.DTYPE_LOWERCASE); | |
Hwr.SetAttribute(settingObj); | |
MakeInputEvent(inkObj, ink_good_morning); | |
int status = Hwr.Recognize(inkObj, resultObj); | |
PrintResult("English Test", status); | |
} | |
static void TestChinese() | |
{ | |
Hwr.ClearLanguage(settingObj); | |
Hwr.AddLanguage(settingObj, Hwr.DLANG_CHINA, Hwr.DTYPE_SIMP); | |
Hwr.SetAttribute(settingObj); | |
MakeInputEvent(inkObj, ink_shanghai); | |
int status = Hwr.Recognize(inkObj, resultObj); | |
PrintResult("Chinese Test", status); | |
} | |
static void TestJapanese() | |
{ | |
Hwr.ClearLanguage(settingObj); | |
Hwr.AddLanguage(settingObj, Hwr.DLANG_JAPANESE, Hwr.DTYPE_HIRAGANA); | |
Hwr.SetAttribute(settingObj); | |
MakeInputEvent(inkObj, ink_arigatou); | |
int status = Hwr.Recognize(inkObj, resultObj); | |
PrintResult("Japanese Test", status); | |
} | |
static int InitializeEngine() | |
{ | |
int status = Hwr.Create("./license_key/license.key"); | |
if (inkObj == IntPtr.Zero) | |
{ | |
inkObj = Hwr.CreateInkObject(); | |
} | |
if (settingObj == IntPtr.Zero) | |
{ | |
settingObj = Hwr.CreateSettingObject(); | |
} | |
if (resultObj == IntPtr.Zero) | |
{ | |
resultObj = Hwr.CreateResultObject(); | |
} | |
Hwr.SetExternalResourcePath("./hdb/"); | |
Hwr.SetExternalLibraryPath("./lib/"); | |
Hwr.SetRecognitionMode(settingObj, Hwr.MULTICHAR); | |
Hwr.SetCandidateSize(settingObj, MAX_CANDIDATES); | |
Console.WriteLine("HWR SDK Revision: {0}", Hwr.GetRevision()); | |
Console.WriteLine("Initialize Engine ...{0}", status == Hwr.ERR_SUCCESS ? "Success" : "Failed"); | |
return status; | |
} | |
static int DestroyEngine() | |
{ | |
int status = Hwr.Close(); | |
if (inkObj != IntPtr.Zero) | |
{ | |
Hwr.DestroyInkObject(inkObj); | |
} | |
if (settingObj != IntPtr.Zero) | |
{ | |
Hwr.DestroySettingObject(settingObj); | |
} | |
if (resultObj != IntPtr.Zero) | |
{ | |
Hwr.DestroyResultObject(resultObj); | |
} | |
Console.WriteLine("Destroy Engine ...{0}", status == Hwr.ERR_SUCCESS ? "Success" : "Failed"); | |
return status; | |
} | |
static void Main() | |
{ | |
InitializeEngine(); | |
TestKorean(); | |
TestEnglish(); | |
TestChinese(); | |
TestJapanese(); | |
DestroyEngine(); | |
} | |
} | |
} |
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
๏ปฟ/*! | |
* @brief Handwriting APIs | |
* @date 2019/12/11 | |
* @file Hwr.cs | |
* @author samu.s.ko | |
* | |
* Copyright 2019. SELVAS AI Inc. All Rights Reserved. | |
*/ | |
using System; | |
using System.Runtime.InteropServices; | |
namespace Selvasai | |
{ | |
class Hwr | |
{ | |
// Gesture List -------------------------------------------------------- | |
public const int GESTURE_LTOR = 1; | |
public const int GESTURE_RTOL = 2; | |
public const int GESTURE_DELETE = 3; | |
public const int GESTURE_BLACK = 4; | |
public const int GESTURE_ENTER = 5; | |
public const int GESTURE_MERGE = 6; | |
public const int GESTURE_AWAY = 7; | |
public const int GESTURE_INSERT = 8; | |
// Error Code ---------------------------------------------------------- | |
/// <summary> | |
/// ์ฑ๊ณต | |
/// </summary> | |
public const int ERR_SUCCESS = 0; | |
/// <summary> | |
/// ์ธ์๊ฒฐ๊ณผ๊ฐ ์์ | |
/// </summary> | |
public const int ERR_NORESULT = 1; | |
/// <summary> | |
/// Null Pointer๋ฅผ ์ฐธ์กฐํจ | |
/// </summary> | |
public const int ERR_NULL_POINTER = 2; | |
/// <summary> | |
/// memory access ๋ฒ์๋ฅผ ๋ฒ์ด๋จ fatal error | |
/// </summary> | |
public const int ERR_OUTOFMEMORY = 3; | |
/// <summary> | |
/// value or size ๋ฒ์๋ฅผ ๋ฒ์ด๋จ exception | |
/// </summary> | |
public const int ERR_OUTOFRANGE = 4; | |
/// <summary> | |
/// ์ ๋ ฅ๋ ๋ฐ์ดํฐ๊ฐ ์์ | |
/// </summary> | |
public const int ERR_EMPTY_INK = 5; | |
/// <summary> | |
/// ์ ๋ ฅ๋ ์ธ์๊ฐ ์๋ชป๋จ | |
/// </summary> | |
public const int ERR_INVALID_ARGUMENTS = 6; | |
/// <summary> | |
/// ์ค์ ๋ ์ธ์๋ชจ๋ธ์ด ๋น์ ์์ ์ | |
/// </summary> | |
public const int ERR_INVALID_MODEL = 7; | |
/// <summary> | |
/// ์๋ชป๋ ๊ฐ์ฒด์ ์ ๊ทผ | |
/// </summary> | |
public const int ERR_INVALID_INSTANCE = 8; | |
/// <summary> | |
/// ๋ฐ๋ชจ ๊ธฐ๊ฐ/ํ์ ๋ง๋ฃ | |
/// </summary> | |
public const int ERR_EXPIRE_DEMO = 9; | |
/// <summary> | |
/// ์์ง์ด ์คํ ์ค | |
/// </summary> | |
public const int ERR_ENGINE_BUSY = 10; | |
/// <summary> | |
/// ์ธ์ฆ ์คํจ | |
/// </summary> | |
public const int ERR_AUTHORIZATION_FAIL = 11; | |
/// <summary> | |
/// ์์ง์ด ์ด๋ฏธ ์กด์ฌํจ | |
/// </summary> | |
public const int ERR_ALREADY_EXIST = 12; | |
// Recognition Mode ---------------------------------------------------- | |
/// <summary> | |
/// ๋ฑ์ ์ธ์ | |
/// </summary> | |
public const int SINGLECHAR = 0; | |
/// <summary> | |
/// ์ฌ๋ฌ ๊ธ์ ์ธ์ | |
/// </summary> | |
public const int MULTICHAR = 1; | |
/// <summary> | |
/// ๊ฒน์ณ ์ด ๊ธ์ ์ธ์ | |
/// </summary> | |
public const int OVERLAPCHAR = 2; | |
/// <summary> | |
/// ์ฌ๋ฌ ์ค๋ก ๋ ๊ธ์ ์ธ์ | |
/// </summary> | |
public const int MULTILINE = 3; | |
// Language Mode ------------------------------------------------------- | |
public const int DLANG_ENGLISH = 0; | |
public const int DLANG_ENGLISH_UK = 1; | |
public const int DLANG_ENGLISH_CA = 2; | |
public const int DLANG_ALBANIAN = 3; | |
public const int DLANG_AUSTRIA = 4; | |
public const int DLANG_BASQUE = 5; | |
public const int DLANG_CATALAN = 6; | |
public const int DLANG_CROATIAN = 7; | |
public const int DLANG_CZECH = 8; | |
public const int DLANG_DANISH = 9; | |
public const int DLANG_DUTCH = 10; | |
public const int DLANG_ESTONIAN = 11; | |
public const int DLANG_FINNISH = 12; | |
public const int DLANG_FRENCH = 13; | |
public const int DLANG_SPANISH = 14; | |
public const int DLANG_SPANISH_MX = 15; | |
public const int DLANG_HUNGARIAN = 16; | |
public const int DLANG_ICELANDIC = 17; | |
public const int DLANG_ITALIAN = 18; | |
public const int DLANG_LATVIAN = 19; | |
public const int DLANG_LITHUANIAN = 20; | |
public const int DLANG_BOKMAL = 21; | |
public const int DLANG_POLISH = 22; | |
public const int DLANG_PORTUGUESE = 23; | |
public const int DLANG_PORTUGUESEB = 24; | |
public const int DLANG_ROMANIAN = 25; | |
public const int DLANG_SLOVAK = 26; | |
public const int DLANG_SLOVENIAN = 27; | |
public const int DLANG_SWEDISH = 28; | |
public const int DLANG_TURKISH = 29; | |
public const int DLANG_VIETNAMESE = 30; | |
public const int DLANG_BELARUSIAN = 31; | |
public const int DLANG_BULGARIAN = 32; | |
// Greek | |
public const int DLANG_GREEK = 33; | |
// Cyrillic | |
public const int DLANG_KAZAKH = 34; | |
public const int DLANG_MACEDONIAN = 35; | |
public const int DLANG_MONGOLIAN = 36; | |
public const int DLANG_RUSSIAN = 37; | |
public const int DLANG_UKRAINIAN = 38; | |
// Latin, Cyrillic | |
public const int DLANG_SERBIAN = 39; | |
public const int DLANG_TATAR = 40; | |
// Oceania | |
public const int DLANG_FIJIAN = 41; | |
public const int DLANG_MAORI = 42; | |
public const int DLANG_SAMOAN = 43; | |
public const int DLANG_TAITIAN = 44; | |
public const int DLANG_TONGAN = 45; | |
// Africa | |
public const int DLANG_OROMO = 46; | |
public const int DLANG_SOTHO = 47; | |
public const int DLANG_SWAHILI = 48; | |
public const int DLANG_SWATI = 49; | |
public const int DLANG_XHOSA = 50; | |
public const int DLANG_ZULU = 51; | |
public const int DLANG_INDONESIAN = 52; | |
public const int DLANG_MALAY = 53; | |
public const int DLANG_GALICIAN = 54; | |
public const int DLANG_GERMANY = 55; | |
public const int DLANG_IRISH = 56; | |
public const int DLANG_AFRIKAANS = 57; | |
public const int DLANG_NYNORSK = 58; | |
public const int DLANG_DUTCH_BE = 59; | |
public const int DLANG_AZERBAIJANI = 60; | |
// CJK | |
public const int DLANG_KOREAN = 101; | |
public const int DLANG_CHINA = 102; | |
public const int DLANG_TAIWAN = 103; | |
public const int DLANG_HONGKONG = 104; | |
public const int DLANG_JAPANESE = 105; | |
// ARABIC | |
public const int DLANG_ARABIC = 106; | |
public const int DLANG_FARSI = 107; | |
public const int DLANG_URDU = 108; | |
// Devanagari | |
public const int DLANG_HINDI = 109; | |
public const int DLANG_BENGALI = 110; | |
// etc | |
public const int DLANG_HEBREW = 111; | |
public const int DLANG_THAI = 112; | |
// max | |
public const int DLANG_MAX = 113; | |
// Language Type ------------------------------------------------------- | |
public const int DTYPE_NONE = (1 << 0); | |
public const int DTYPE_UPPERCASE = (1 << 1); | |
public const int DTYPE_LOWERCASE = (1 << 2); | |
public const int DTYPE_CONSONANT = (1 << 3); | |
public const int DTYPE_VOWEL = (1 << 4); | |
public const int DTYPE_TONE = (1 << 5); | |
public const int DTYPE_NUMERIC = (1 << 6); | |
public const int DTYPE_SIGN = (1 << 7); | |
// JAPANESE | |
public const int DTYPE_HIRAGANA = (1 << 8); | |
public const int DTYPE_KATAKANA = (1 << 9); | |
public const int DTYPE_KANJI = (1 << 10); | |
// CHINA, TAIWAN, HONGKONG | |
public const int DTYPE_SIMP = (1 << 11); | |
public const int DTYPE_TRAD = (1 << 12); | |
public const int DTYPE_RADICAL = (1 << 13); | |
// SERBIAN, TATAR | |
public const int DTYPE_LATIN = (1 << 14); | |
public const int DTYPE_CYRILLIC = (1 << 15); | |
// ARABIC, FARSI, URDU | |
public const int DTYPE_ARABIC = (1 << 16); | |
// HEBREW | |
public const int DTYPE_HEBREW = (1 << 17); | |
// BENGALI, HINDI | |
public const int DTYPE_DEVANAGARI = (1 << 18); | |
// KOREAN | |
public const int DTYPE_KOREAN = (1 << 19); | |
public const int DTYPE_HANJA = (1 << 20); | |
// gesture for editing (space, backspace ๋ฑ) | |
public const int DTYPE_GESTURE = (1 << 21); | |
// Param type ---------------------------------------------------------- | |
public const int LOG_LEVEL = 0; | |
public const int LOG_CALLBACK = 1; | |
public const int WRITE_INK = 2; | |
public const int LANG_MODEL = 3; | |
// Log level ----------------------------------------------------------- | |
public const int LEVEL_NONE = 0; | |
public const int LEVEL_ERROR = 1; | |
public const int LEVEL_WARN = 2; | |
public const int LEVEL_INFO = 3; | |
public const int LEVEL_DEBUG = 4; | |
// Main APIs ----------------------------------------------------------- | |
/// <summary> | |
/// ์ธ์์์ง์ ์ธ์คํด์ค๋ฅผ ์์ฑํจ | |
/// </summary> | |
/// <param name="keyPath">[in] ํ์ผ๋ช ์ ํฌํจํ License key ํ์ผ์ ๊ฒฝ๋ก</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRCreate")] | |
public static extern int Create(String keyPath); | |
/// <summary> | |
/// ์ธ์๋ชจ๋ ์์ฑ ๊ฐ์ ์ค์ ํจ | |
/// </summary> | |
/// <param name="setting">[in] setting ์ค์ ์ด ์๋ฃ๋ Setting Object</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetAttribute")] | |
public static extern int SetAttribute(IntPtr setting); | |
/// <summary> | |
/// ์ธ์๋ชจ๋ ์์ฑ ๊ฐ์ ๋ฐ๋ผ ์ ๋ ฅ ๋ฐ์ดํฐ๋ฅผ ์ธ์ํจ | |
/// </summary> | |
/// <param name="ink">[in] ink ์ขํ๊ฐ ์ ๋ ฅ๋ Ink Object</param> | |
/// <param name="result">[out] ์ธ์๋ ๊ฒฐ๊ณผ๊ฐ ์ ์ฅ๋ Result Object</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRecognize")] | |
public static extern int Recognize(IntPtr ink, IntPtr result); | |
/// <summary> | |
/// ์ธ์์์ง์ ์ธ์คํด์ค๋ฅผ ์๋ฉธ์ํด | |
/// </summary> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRClose")] | |
public static extern int Close(); | |
// Optional APIs ------------------------------------------------------- | |
/// <summary> | |
/// ์์ง๋ด๋ถ์์ ์ฌ์ฉํ๋ ์ธ๋ถ๋ฆฌ์์ค(์ธ์ด๋ชจ๋ธ ํ์ผ ๋ฑ)์ ๊ฒฝ๋ก ์ค์ | |
/// </summary> | |
/// <param name="path">[in] path ๋ฆฌ์์ค ๊ฒฝ๋ก</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetExternalResourcePath")] | |
public static extern int SetExternalResourcePath(String path); | |
/// <summary> | |
/// ์์ง๋ด๋ถ์์ ์ฌ์ฉํ๋ ์ธ๋ถ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ฒฝ๋ก ์ค์ | |
/// </summary> | |
/// <param name="path">[in] path ์ธ๋ถ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ฒฝ๋ก</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetExternalLibraryPath")] | |
public static extern int SetExternalLibraryPath(String path); | |
/// <summary> | |
/// ํน์ ํ์ ์ ํ๋ผ๋ฏธํฐ ๊ฐ์ ๊ฐ์ ธ์ด | |
/// </summary> | |
/// <param name="type">[in] ํ๋ผ๋ฏธํฐ ํ์ </param> | |
/// <param name="param">[out] ํน์ ํ๋ฆฌ๋ฏธํฐ ํ์ ์ ํฌ์ธํฐ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetParam")] | |
public static extern int GetParam(int type, [In, Out] ref int param); | |
/// <summary> | |
/// ํน์ ํ์ ์ ํ๋ผ๋ฏธํฐ ๊ฐ์ ์ค์ ํจ | |
/// </summary> | |
/// <param name="type">[in] ํ๋ผ๋ฏธํฐ ํ์ </param> | |
/// <param name="param">[in] ํน์ ํ๋ฆฌ๋ฏธํฐ ํ์ ์ ํฌ์ธํฐ</param> | |
/// <returns></returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetParam")] | |
public static extern int SetParam(int type, [In, Out] ref int param); | |
/// <summary> | |
/// ์์ง์ ๋น๋๋๋ฒ ์คํธ๋ง์ ํฌ์ธํฐ๋ฅผ ๊ฐ์ ธ์ด | |
/// </summary> | |
/// <param name="revision">[out] ์์ง ๋น๋๋๋ฒ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetRevision")] | |
public static extern int GetRevisionPtr(IntPtr[] revision); | |
/// <summary> | |
/// ์์ง์ ๋น๋๋๋ฒ ์คํธ๋ง์ ๋ฐํ | |
/// </summary> | |
/// <returns>์์ง์ ๋น๋๋๋ฒ ์คํธ๋ง</returns> | |
public static String GetRevision() | |
{ | |
IntPtr[] version = new IntPtr[1]; | |
Hwr.GetRevisionPtr(version); | |
return Marshal.PtrToStringAnsi(version[0]); | |
} | |
/// <summary> | |
/// License key์ ์ค์ ๋ ์์ง์ due date๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="due_date">[out] ๋ ์์ผ์ ๋ํ๋ด๋ 8์๋ฆฌ์ integer ๊ฐ (ex 20161206)</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetDueDate")] | |
public static extern int GetDueDate([In, Out] ref int due_date); | |
// SettingObject APIs -------------------------------------------------- | |
/// <summary> | |
/// ์ค์ ์ค๋ธ์ ํธ๋ฅผ ์์ฑํ๋ค | |
/// </summary> | |
/// <returns>์ค์ ์ค๋ธ์ ํธ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRCreateSettingObject")] | |
public static extern IntPtr CreateSettingObject(); | |
/// <summary> | |
/// ์ค์ ์ค๋ธ์ ํธ๋ฅผ ์ ๊ฑฐํ๋ค | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRDestroySettingObject")] | |
public static extern void DestroySettingObject(IntPtr setting); | |
/// <summary> | |
/// ํ๊ธฐ ์ธ์ ๋ชจ๋๋ฅผ ์ค์ ํ๋ค(๋ฑ์, ์ฐ์) | |
/// </summary> | |
/// <param name="setting"> [in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <param name="mode">[in] ์ธ์ ๋ชจ๋</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetRecognitionMode")] | |
public static extern int SetRecognitionMode(IntPtr setting, int mode); | |
/// <summary> | |
/// ์ธ์ ํ๋ณด ์ถ๋ ฅ ํฌ๊ธฐ๋ฅผ ์ค์ ํ๋ค | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <param name="size">[in] ํ๋ณด์</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetCandidateSize")] | |
public static extern int SetCandidateSize(IntPtr setting, int size); | |
/// <summary> | |
/// ์ธ์ํ ์ธ์ด๋ฅผ ์ถ๊ฐ ํ๋ค | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <param name="language">[in] ์ธ์ด ๊ฐ</param> | |
/// <param name="option">[in] ๋ฐ๋ฅธ ์ต์ </param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRAddLanguage")] | |
public static extern int AddLanguage(IntPtr setting, int language, int option); | |
/// <summary> | |
/// ์ค์ ๋ ์ธ์ด ํฌ๊ธฐ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <param name="size">[out] ํฌ๊ธฐ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetLanguageSize")] | |
public static extern int GetLanguageSize(IntPtr setting, [In, Out] ref int size); | |
/// <summary> | |
/// ์ค์ ๋ ์ธ์ด๋ฅผ ์ด๊ธฐํ ํ๋ค | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRClearLanguage")] | |
public static extern int ClearLanguage(IntPtr setting); | |
/// <summary> | |
/// ์ธ์ํ ์ฌ๋ณผ์ ์ ์ | |
/// </summary> | |
/// <param name="setting">[in] ์ค์ ์ค๋ธ์ ํธ</param> | |
/// <param name="charset">[in] ์ธ์ํ ์ฌ๋ณผ์ ๋ฆฌ์คํธ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRSetUserCharSet")] | |
public static extern int SetUserCharSet(IntPtr setting, [In] ushort[] charset); | |
// InkObject APIs ------------------------------------------------------ | |
/// <summary> | |
/// ์ํฌ ์ค๋ธ์ ํธ๋ฅผ ์์ฑํ๋ค | |
/// </summary> | |
/// <returns>์ํฌ ์ค๋ธ์ ํธ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRCreateInkObject")] | |
public static extern IntPtr CreateInkObject(); | |
/// <summary> | |
/// ์ํฌ ์ค๋ธ์ ํธ๋ฅผ ์ ๊ฑฐํ๋ค | |
/// </summary> | |
/// <param name="ink">[in] ์ํฌ ์ค๋ธ์ ํธ</param> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRDestroyInkObject")] | |
public static extern void DestroyInkObject(IntPtr ink); | |
/// <summary> | |
/// ์ธ์์์ง์์ ์ธ์ํ ํฐ์น ์ขํ(์ํฌ ์ขํ)๋ฅผ ์ถ๊ฐํจ | |
/// </summary> | |
/// <param name="ink">[in] ink ์ํฌ ์ค๋ธ์ ํธ</param> | |
/// <param name="x">[in] x์ขํ</param> | |
/// <param name="y">[in] y์ขํ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRAddPoint")] | |
public static extern int AddPoint(IntPtr ink, int x, int y); | |
/// <summary> | |
/// TouchUp ์ด๋ฒคํธ์ ์ํด ํ ํ์ ์ ๋ ฅ์ ๋ง์ณค์ ๋ ํธ์ถํจ | |
/// </summary> | |
/// <param name="ink">[in] ์ํฌ ์ค๋ธ์ ํธ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWREndStroke")] | |
public static extern int EndStroke(IntPtr ink); | |
/// <summary> | |
/// ์ ๋ ฅํ ์ขํ ๋ฐ์ดํฐ๋ฅผ ์ด๊ธฐํํจ | |
/// </summary> | |
/// <param name="ink">[in] ์ํฌ ์ค๋ธ์ ํธ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRInkClear")] | |
public static extern int InkClear(IntPtr ink); | |
/// <summary> | |
/// ์ ๋ ฅ๋ ์ํฌ ์ธ๋ฑ์ค ๊ฐ์ ํด๋นํ๋ ์ํฌ ์ขํ๊ฐ์ ๋ฐ์์ด | |
/// </summary> | |
/// <param name="ink">[in] ์ํฌ ์ค๋ธ์ ํธ</param> | |
/// <param name="index">[in] ๋ฐ์์ค๊ณ ์ ํ๋ ์ํฌ์ ์ธ๋ฑ์ค</param> | |
/// <param name="x">[out] ํด๋น ์ํฌ์ x์ขํ๊ฐ</param> | |
/// <param name="y">[out] ํด๋น ์ํฌ์ y์ขํ๊ฐ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetInkPoint")] | |
public static extern int GetInkPoint(IntPtr ink, int index, [In, Out] ref int x, [In, Out] ref int y); | |
/// <summary> | |
/// ํ์ฌ๊น์ง ์ ๋ ฅ๋ ์ํฌ์ ์นด์ดํธ | |
/// </summary> | |
/// <param name="ink">[in] ์ํฌ ์ค๋ธ์ ํธ</param> | |
/// <param name="count">[out] ์ํฌ ์นด์ดํธ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetInkCount")] | |
public static extern int GetInkCount(IntPtr ink, [In, Out] ref int count); | |
// ResultObject APIs --------------------------------------------------- | |
/// <summary> | |
/// ๊ฒฐ๊ณผ ์ค๋ธ์ ํธ๋ฅผ ์์ฑํ๋ค | |
/// </summary> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRCreateResultObject")] | |
public static extern IntPtr CreateResultObject(); | |
/// <summary> | |
/// ๊ฒฐ๊ณผ ์ค๋ธ์ ํธ๋ฅผ ์ ๊ฑฐํ๋ค | |
/// </summary> | |
/// <param name="result">[in] ๊ฒฐ๊ณผ ์ค๋ธ์ ํธ</param> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRDestroyResultObject")] | |
public static extern void DestroyResultObject(IntPtr result); | |
/// <summary> | |
/// ๊ฒฐ๊ณผ ๊ฐ์ ๋ผ์ธ ํฌ๊ธฐ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="ink">[in] ๊ฒฐ๊ณผ ์ค๋ธ์ ํธ</param> | |
/// <returns>Line Size</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetLineSize")] | |
public static extern int GetLineSize(IntPtr ink); | |
/// <summary> | |
/// ์ง์ ๋ ์ธ๋ฑ์ค์ ๋ผ์ธ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="result">[in] ๊ฒฐ๊ณผ ์ค๋ธ์ ํธ</param> | |
/// <param name="index">[in] ๋ผ์ธ ์ธ๋ฑ์ค</param> | |
/// <returns>๋ผ์ธ ๊ฒฐ๊ณผ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetLine")] | |
public static extern IntPtr GetLine(IntPtr result, int index); | |
/// <summary> | |
/// ๋ผ์ธ ๊ฒฐ๊ณผ ๊ฐ์ ๋ธ๋ญ ํฌ๊ธฐ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="line">[in] ๋ผ์ธ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <returns>Block Size</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetBlockSize")] | |
public static extern int GetBlockSize(IntPtr line); | |
/// <summary> | |
/// ๋ผ์ธ ๊ฒฐ๊ณผ ๊ฐ์ ์ง์ ๋ ์ธ๋ฑ์ค์ ๋ธ๋ญ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="line">[in] ๋ผ์ธ</param> | |
/// <param name="index">[in] ๋ธ๋ญ ์ธ๋ฑ์ค</param> | |
/// <returns>๋ธ๋ญ ๊ฒฐ๊ณผ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetBlock")] | |
public static extern IntPtr GetBlock(IntPtr line, int index); | |
/// <summary> | |
/// ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ์ ์ฒ๋ฆฌ๋ ํ์ ๊ฐ์๋ฅผ ์ป์ด์จ๋ค | |
/// </summary> | |
/// <param name="block">[in] ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <returns>Stroke Size</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetStrokeSize")] | |
public static extern int GetStrokeSize(IntPtr block); | |
/// <summary> | |
/// ๋ธ๋ญ ๊ฒฐ๊ณผ๊ฐ์ ์ฒ๋ฆฌ๋ ํ์ ์ธ๋ฑ์ค๋ค์ ์ป์ด์จ๋ค | |
/// </summary> | |
/// <param name="block">[in] ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <param name="indices">[out] ์ธ๋ฑ์ค ํฌ์ธํฐ</param> | |
/// <param name="size">[in] ์ธ๋ฑ์ค ํฌ์ธํฐ ์ฌ์ด์ฆ</param> | |
/// <returns>์๋ฌ ์ฝ๋ ๊ฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetStrokeIndices")] | |
public static extern int GetStrokeIndices(IntPtr block, [In, Out] ref int indices, int size); | |
/// <summary> | |
/// ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ์์ ํ๋ณด ํฌ๊ธฐ๋ฅผ ๊ฐ์ ธ์จ๋ค | |
/// </summary> | |
/// <param name="block">[in] ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <returns>Candidate Size</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetCandidateSize")] | |
public static extern int GetCandidateSize(IntPtr block); | |
/// <summary> | |
/// ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ์์ ์ธ์ ํ๋ณด๋ฌธ์์ ํฌ์ธํฐ๋ฅผ ๋ฐํํ๋ค | |
/// </summary> | |
/// <param name="block">[in] ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <param name="index">[in] ํ๋ณด ์ธ๋ฑ์ค</param> | |
/// <param name="length">[out] ์ธ์ํ๋ณด ๋ฌธ์์ด ํฌ๊ธฐ</param> | |
/// <returns>ํ๋ณด๋ฌธ์์ ํฌ์ธํฐ</returns> | |
[DllImport("libdhwr.dll", EntryPoint = "DHWRGetCandidate")] | |
public static extern IntPtr GetCandidatePtr(IntPtr block, int index, [In, Out] ref int length); | |
/// <summary> | |
/// ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ์์ ์ธ์๋ ํ๋ณด๋ฌธ์๋ฅผ ๋ฐํํ๋ค | |
/// </summary> | |
/// <param name="block">[in] ๋ธ๋ญ ๊ฒฐ๊ณผ ๊ฐ</param> | |
/// <param name="index">[in] ํ๋ณด ์ธ๋ฑ์ค</param> | |
/// <param name="length">[out] ์ธ์ํ๋ณด ๋ฌธ์์ด ํฌ๊ธฐ</param> | |
/// <returns>ํ๋ณด๋ฌธ์</returns> | |
public static String GetCandidate(IntPtr block, int index, [In, Out] ref int length) | |
{ | |
return Marshal.PtrToStringUni(GetCandidatePtr(block, index, ref length)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment