diff --git a/PaperInkConverter/PaperInkConverter.sln b/PaperInkConverter/PaperInkConverter.sln new file mode 100644 index 0000000..bd3acbe --- /dev/null +++ b/PaperInkConverter/PaperInkConverter.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PaperInkConverter", "PaperInkConverter\PaperInkConverter.vcproj", "{BB7433D1-E49A-4752-B780-9B4CECF3928D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB7433D1-E49A-4752-B780-9B4CECF3928D}.Debug|Win32.ActiveCfg = Debug|Win32 + {BB7433D1-E49A-4752-B780-9B4CECF3928D}.Debug|Win32.Build.0 = Debug|Win32 + {BB7433D1-E49A-4752-B780-9B4CECF3928D}.Release|Win32.ActiveCfg = Release|Win32 + {BB7433D1-E49A-4752-B780-9B4CECF3928D}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PaperInkConverter/PaperInkConverter/Debug/BuildLog.htm b/PaperInkConverter/PaperInkConverter/Debug/BuildLog.htm new file mode 100644 index 0000000..e936333 Binary files /dev/null and b/PaperInkConverter/PaperInkConverter/Debug/BuildLog.htm differ diff --git a/PaperInkConverter/PaperInkConverter/Debug/PaperInkConverter.obj b/PaperInkConverter/PaperInkConverter/Debug/PaperInkConverter.obj new file mode 100644 index 0000000..eb52e6a Binary files /dev/null and b/PaperInkConverter/PaperInkConverter/Debug/PaperInkConverter.obj differ diff --git a/PaperInkConverter/PaperInkConverter/Debug/vc90.idb b/PaperInkConverter/PaperInkConverter/Debug/vc90.idb new file mode 100644 index 0000000..ce944d9 Binary files /dev/null and b/PaperInkConverter/PaperInkConverter/Debug/vc90.idb differ diff --git a/PaperInkConverter/PaperInkConverter/Debug/vc90.pdb b/PaperInkConverter/PaperInkConverter/Debug/vc90.pdb new file mode 100644 index 0000000..2c03ca8 Binary files /dev/null and b/PaperInkConverter/PaperInkConverter/Debug/vc90.pdb differ diff --git a/PaperInkConverter/PaperInkConverter/PaperInkConverter.cpp b/PaperInkConverter/PaperInkConverter/PaperInkConverter.cpp new file mode 100644 index 0000000..96d2e7f --- /dev/null +++ b/PaperInkConverter/PaperInkConverter/PaperInkConverter.cpp @@ -0,0 +1,438 @@ +/********************************************************************************** + * Copyright : (C) 2012 by Herbert Ellebruch + * Email : herbert@useful-tools.de + + ********************************************************************************** + * * + * PaperInkConverter is free software: you can redistribute it and/or modify * + * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * PaperInkConverter is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE * + * along with PaperInkConverter. If not, see . * + * * + *********************************************************************************/ + /* ******************************************************************************* + Modifications: + 17.Sep 2012 Ellebruch Herbert + Modified Start of Stroke Data + */ +#include +#include + +#include "PaperInkConverter.h" + +PaperInkConverter::PaperInkConverter(wchar_t* Filename, int StrokeThreshold_In, int AllThreshold_In, int SlidingThreshold_In){ + f = _wfopen(Filename,L"rb"); + if (f == NULL) { + SensitivityStrokeIndexList = NULL; + PenPosition_X = NULL; + PenPosition_Y = NULL; + PenPressure = NULL; + PenTilt_X = NULL; + PenTilt_Y = NULL; + + Number_of_Points_in_Substroke = -1; + FileClose = true; + } else { + FileClose = false; + + + maxLayerPressure = 0; + maxSlidingPressure = 0; + + AllThreshold = AllThreshold_In * 164; // Threshold in % * 16384 / 100 (2**14); + StrokeThreshold = StrokeThreshold_In * 164; // Threshold in % * 16384 / 100 (2**14) + + char DummyMem[0x7f8]; // Dummy Buffer to receive unused Dummy information + size_t FileSize = fread((void*)&DummyMem[0],1,sizeof(DummyMem),f); + if (FileSize != sizeof(DummyMem)) { + fclose(f); + Number_of_Points_in_Substroke = -1; + FileClose = true; + } else { + SensitivityStrokeIndexList = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPosition_X = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPosition_Y = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPressure = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenTilt_X = (unsigned char*)malloc(MaxStoreBuffer); + PenTilt_Y = (unsigned char*)malloc(MaxStoreBuffer); + *SensitivityStrokeIndexList = 0; // Preset this 2 Values Only Relevant, if there ist + *(SensitivityStrokeIndexList+1) = 0; // no Stroke in the file + + int Status = ReadNextCompleteStroke(); + if (Status == 2) { + // End of File found + freeAllMemory(); + // Already done in ReadNextCompleteStroke + // fclose(f); + // Number_of_Points_in_Substroke = -1; + // FileClose = true; + } + } + } +} + + int PaperInkConverter::ReadGraphicBlock() { + do { + size_t BytesRed = fread((void*)&GraphicBlockMem[0],1,2,f); // Read Block Descriptor and Size + if (BytesRed >= 2) { + Descriptor = GraphicBlockMem[0]; + BlockSize = GraphicBlockMem[1] - 2; + + size_t BlockBytesRed = fread((void*)&GraphicBlockMem[0],1,BlockSize,f); // Read the complete Block + if (BlockBytesRed != BlockSize) { + Number_of_Points_in_Substroke = -1; + FileClose = true; + fclose(f); + // TODO Error Message + return 2; // End of file Found + } + } else { + Number_of_Points_in_Substroke = -1; + FileClose = true; + fclose(f); + return 2; // End of file Found + } + BlockSize = BlockSize; // Subtract Descriptor and Blocksize + } while (BlockSize == 0); // ignore empty Blocks + return 0; // Block is available + } + + /// Search for Stroke Start + // Descriptor 241 Marks Start Stroke Stroke End and New Layer + // 241 03 01 Start of Stroke + // 241 03 00 End of Stroke + // 241 03 128 New Layer + int PaperInkConverter::findStrokeStart() { + int BlockAvailable = 2; // Set block Availble to End of File + int BlockStatus = 0; // Set Blockstatus to Block found + while (1) { + BlockAvailable = ReadGraphicBlock(); + if (BlockAvailable == 0) { + // 241 03 01 Start of Stroke + // 241 03 00 End of Stroke + // 241 03 128 New Layer + if (Descriptor == 241) { // Stroke Delimiter found + int LayerDescriptor = GraphicBlockMem[0]; + if (LayerDescriptor == 01) { // Stroke Start Found + break; + } else if (LayerDescriptor == 00) { // Layer end found + BlockStatus = 1; // Set BlockStatus to Layer end + break; + } else if (LayerDescriptor == 128) { // Layer Changed + BlockStatus = 1; // Set BlockStatus to Layer end + Layer++; + } + } + } else { + BlockStatus = 2; // Set BlockStatus to End of File + break; + } + } + return BlockStatus; + } + +bool PaperInkConverter::RecalcalateStrokesWithThreshold() { + +/* Testpoints +PenPressure[0] = 0; +PenPressure[1] = 0; +PenPressure[2] = 10000; +PenPressure[3] = 10000; +PenPressure[4] = 0; +PenPressure[5] = 0; +PenPressure[6] = 10000; +PenPressure[7] = 10000; +Number_of_Points = 8; +*/ + short* pactualPressure = PenPressure; + short* pactualStrokeIndex = SensitivityStrokeIndexList; + SubStrokeIndex = 0; + int actualThresholdStrokeIndex = 0; + if ((AllThreshold == 0) && (StrokeThreshold == 0)) { // no Threshold set + numberOfSubStrokes = 1; + Number_of_Points_in_Substroke = Number_of_Points; + *SensitivityStrokeIndexList = 0; + } else { + int actualRelativeThreshold = (maxStrokePressure * StrokeThreshold) >> 14; + if (LayerThreshold < actualRelativeThreshold) { + if (AllThreshold > 0 ) { + actualRelativeThreshold = LayerThreshold; + } + } else { + if (StrokeThreshold == 0) { + actualRelativeThreshold = LayerThreshold; + } + } + int PointCount = 0; + numberOfSubStrokes = 0; + int Number_Of_Points_To_Process = Number_of_Points - 1; + // while (PointCount < Number_of_Points) { + do { + while (*pactualPressure++ < actualRelativeThreshold) { + // pactualPressure++; + PointCount++; + if (PointCount > Number_Of_Points_To_Process) { + break; + } + } + if (PointCount > Number_Of_Points_To_Process) break; + *pactualStrokeIndex++ = PointCount; + numberOfSubStrokes++; + pactualPressure--; + while (*pactualPressure++ > actualRelativeThreshold) { + // pactualPressure++; + PointCount++; + if (PointCount > Number_Of_Points_To_Process) { + break; + } + } + if ((PointCount - *(pactualStrokeIndex-1)) < 2) { + numberOfSubStrokes--; + pactualStrokeIndex--; + } else { + *pactualStrokeIndex++ = PointCount - 1; + } + } while ((PointCount <= Number_Of_Points_To_Process)); + Number_of_Points_in_Substroke = *(SensitivityStrokeIndexList+1) - *SensitivityStrokeIndexList + 1; + } + return (numberOfSubStrokes == 0); +} + +void PaperInkConverter::freeAllMemory() { + if (SensitivityStrokeIndexList != NULL) { + free(SensitivityStrokeIndexList); + SensitivityStrokeIndexList = NULL; + } + if (PenPosition_X != NULL) { + free(PenPosition_X); + PenPosition_X = NULL; + } + if (PenPosition_Y != NULL) { + free(PenPosition_Y); + PenPosition_Y = NULL; + } + if (PenPressure != NULL) { + free(PenPressure); + PenPressure = NULL; + } + if (PenTilt_X != NULL) { + free(PenTilt_X); + PenTilt_X = NULL; + } + if (PenTilt_Y != NULL) { + free(PenTilt_Y); + PenTilt_Y = NULL; + } +} + +PaperInkConverter::~PaperInkConverter() +{ + freeAllMemory(); +} + +int PaperInkConverter::EOF_Found() +{ + if (FileClose) { + freeAllMemory(); + return(MANAGED_TRUE); + } else { + return(MANAGED_FALSE); + } +} + +short* PaperInkConverter::GetPenPositionX() { + short* temp = pPenPositionStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; +short* PaperInkConverter::GetPenPositionY() { + short* temp = pPenPositionStart_Y + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; +short* PaperInkConverter::GetPenPressure() { + short* temp = pPenPositionStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +unsigned char* PaperInkConverter::GetPenTiltX() { + unsigned char* temp = pPenTiltStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +unsigned char* PaperInkConverter::GetPenTiltY() { + unsigned char* temp = pPenTiltStart_Y + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +int PaperInkConverter::ReadNextStroke() { +/* + StrokeMaximum.x = 0x7FFFFFF; + StrokeMaximum.y = 0x7FFFFFF; + + StrokeMinimum.x = -0x7FFFFFF; + StrokeMinimum.y = -0x7FFFFFF; + + StrokeStart.x = 0; + StrokeStart.y = 0; + pPenPositionStart_X = pPenPosition_X = &PenPosition_X[0];; + pPenPositionStart_Y = pPenPosition_Y = &PenPosition_Y[0];; + pPenPressureStart = pPenPressure = &PenPressure[0]; + + pPenTiltStart_X = pPenTilt_X = &PenTilt_X[0]; + pPenTiltStart_Y = pPenTilt_Y = &PenTilt_Y[0]; +*/ + + bool BlockAvailable = true; + int Blockstatus = 0; // Set Block Status to Strokes available + numberOfSubStrokes--; + if (numberOfSubStrokes <= 0) { + Blockstatus = ReadNextCompleteStroke(); + } else { + SubStrokeIndex = SubStrokeIndex + 2; + Number_of_Points_in_Substroke = *(SensitivityStrokeIndexList+SubStrokeIndex+1) - *(SensitivityStrokeIndexList+SubStrokeIndex) + 1; + + } + + return Blockstatus; +} +int PaperInkConverter::ReadNextCompleteStroke() { +/* testpoints + pactualStroke->Max.x = -0x7FFFFFF; + pactualStroke->Max.y = -0x7FFFFFF; + + pactualStroke->Min.x = 0x7FFFFFF; + pactualStroke->Min.y = 0x7FFFFFF; + + pactualStroke->Start.x = 0; + pactualStroke->Start.y = 0; +*/ + + FullStrokeMaximum.x = 0x7FFFFFF; + FullStrokeMaximum.y = 0x7FFFFFF; + + FullStrokeMinimum.x = -0x7FFFFFF; + FullStrokeMinimum.y = -0x7FFFFFF; + + FullStrokeStart.x = 0; + FullStrokeStart.y = 0; + + pPenPositionStart_X = pPenPosition_X = PenPosition_X; + pPenPositionStart_Y = pPenPosition_Y = PenPosition_Y; + pPenPressureStart = pPenPressure = PenPressure; + + pPenTiltStart_X = pPenTilt_X = PenTilt_X; + pPenTiltStart_Y = pPenTilt_Y = PenTilt_Y; + + maxStrokePressure = 0; + + Descriptor = 0; + Number_of_Points = 0; + bool NoPointsInStroke = true; + int BlockAvailable; + int StrokeStatus; + do { + StrokeStatus = findStrokeStart(); + BlockAvailable = StrokeStatus; + while (BlockAvailable != 2) { // while More Strokes Available + BlockAvailable = ReadGraphicBlock(); // it only returns 0 and 2; + if (BlockAvailable == 0) { + if ( (Descriptor == 97) ) { // Descriptor 97 Contains Position x and Position y + // Position x in 1 mm Increments + // Position y in 2 mm Increments + // Format : + // 96 06 Position x Position Y + // 1 1 2 2 Byte + // + // + // int Posx = (((int)(char) (*pConvertStart++)) << 8); + // Posx = Posx + (int)(*pConvertStart++) + 5 ; // Get Pos x + int Posx = (((int)(char) GraphicBlockMem[0]) << 8); + Posx = Posx + (int)(GraphicBlockMem[1]) + 5 ; // Get Pos x + // int Posy = (((int)(char) (*pConvertStart++)) << 8); + // Posy = ((Posy + (int)(*pConvertStart++)) << 1) + 5 ; // Get Pos y + int Posy = (((int)(char) GraphicBlockMem[2]) << 8); + Posy = ((Posy + (int)GraphicBlockMem[3]) << 1) + 5 ; // Get Pos y + // pactualPoint->MySinglePoint.x = Posx; + // pactualPoint->MySinglePoint.y = Posy; + *pPenPosition_X = Posx; + *pPenPosition_Y = Posy; + } else if ( (Descriptor == 100) ){ // Descriptor 100 contains Pen Pressur + // Format : + // 100 06 unknown unknown Pressur + // 1 1 1 1 2 Byte + // + // + int Pressure = (((int)GraphicBlockMem[2]) << 8); + Pressure = Pressure + (int)(GraphicBlockMem[3]); // Get Pressure + + if (Pressure > maxStrokePressure) { + maxStrokePressure = Pressure; + } + *pPenPressure = Pressure; + // move Pressure to one Position set first position + } else if ( (Descriptor == 101) ){ // Descriptor 101 Contains Pen Tilt x and Pen Tilt y of the pen + // Format : + // 101 06 Tilt x Tilt Y u u + // 1 1 1 1 1 1 Byte + // + // + + int Tilt_x = GraphicBlockMem[0]; // Get Tilt x + int Tilt_y = GraphicBlockMem[1]; // Get Tilt y + + *pPenTilt_X = Tilt_x; + *pPenTilt_Y = Tilt_y; + // Recalculate Mininum and Maximum + Number_of_Points++; // Increment Number of Points + + if (*pPenPosition_X < FullStrokeMaximum.x) { + FullStrokeMaximum.x = *pPenPosition_X; + } + if (*pPenPosition_Y < FullStrokeMinimum.y) { + FullStrokeMinimum.y = *pPenPosition_Y; + } + if (*pPenPosition_X > FullStrokeMaximum.x) { + FullStrokeMaximum.x = *pPenPosition_X; + } + if (*pPenPosition_Y > FullStrokeMaximum.y) { + FullStrokeMaximum.y = *pPenPosition_Y; + } + + if (Number_of_Points < MaxStoreBuffer) { + pPenPosition_X++; + pPenPosition_Y++; + pPenPressure++; + pPenTilt_X++; + pPenTilt_Y++; + } else { + // ignore this points + // to do insert Error Message + } + } else if ( (Descriptor == 241) ) { + int LayerDescriptor = GraphicBlockMem[0]; + if (LayerDescriptor == 0) { // Stroke End Found + break; + } + } else { + // Unknown Identifier + // ignore this block + } + } + } + if (Number_of_Points > 0) { + if (maxStrokePressure > maxLayerPressure) { + maxLayerPressure = maxStrokePressure; + LayerThreshold = (maxLayerPressure * AllThreshold) >> 14; + } + NoPointsInStroke = RecalcalateStrokesWithThreshold(); + } + } while (NoPointsInStroke && (BlockAvailable == 0)); + return StrokeStatus; +} diff --git a/PaperInkConverter/PaperInkConverter/PaperInkConverter.h b/PaperInkConverter/PaperInkConverter/PaperInkConverter.h new file mode 100644 index 0000000..d2dbdb8 --- /dev/null +++ b/PaperInkConverter/PaperInkConverter/PaperInkConverter.h @@ -0,0 +1,86 @@ + +#define MANAGED_TRUE 1 +#define MANAGED_FALSE 0 + +typedef struct MySinglePoint { + int x; + int y; +} MySinglePoint; + +class PaperInkConverter { +private: + FILE* f; + bool FileClose; +short* pPenPosition_X; +short* pPenPosition_Y; +short* pPenPressure; + +unsigned char* pPenTilt_X; +unsigned char* pPenTilt_Y; + +short* pPenPositionStart_X; +short* pPenPositionStart_Y; +short* pPenPressureStart; + +unsigned char* pPenTiltStart_X; +unsigned char* pPenTiltStart_Y; + +short* SensitivityStrokeIndexList; +#define MaxStoreBuffer 20000 +short* PenPosition_X; +short* PenPosition_Y; +short* PenPressure; +unsigned char* PenTilt_X; +unsigned char* PenTilt_Y; + + + +int Number_of_Points; +int numberOfSubStrokes; +int Number_of_Points_in_Substroke; +// int SensitivityStrokeIndex; +int SubStrokeIndex; + +MySinglePoint FullStrokeMaximum; +MySinglePoint FullStrokeMinimum; +MySinglePoint FullStrokeStart; + +int AllThreshold; // Contains Threshold in % * 16384 / 100 (2**14) +int StrokeThreshold; // Contains Threshold in % * 16384 / 100 (2**14 + +int maxStrokePressure; + +int maxLayerPressure; +int LayerThreshold; + +int maxSlidingPressure; + + + int Layer; + int BlockSize; + int Descriptor; + unsigned char GraphicBlockMem[256]; + + int ReadGraphicBlock(); + bool RecalcalateStrokesWithThreshold(); + int ReadNextCompleteStroke(); + int findStrokeStart(); + void PaperInkConverter::freeAllMemory(); + +public: + PaperInkConverter(wchar_t* filename, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); + ~PaperInkConverter(); + int EOF_Found(); + void SetAllSensitivity(int Sensitivity) { AllThreshold = Sensitivity * 164; }; // Threshold in % * 16384 / 100 (2**14); + void SetStrokeSensitivity(int Sensitivity) { StrokeThreshold = Sensitivity * 164; }; // Threshold in % * 16384 / 100 (2**14) + int ReadNextStroke(); + int GetLayer() {return(Layer);}; + int GetNumberOfPoints() {return(Number_of_Points_in_Substroke);}; + + short* GetPenPositionX(); + short* GetPenPositionY(); + short* GetPenPressure(); + unsigned char* GetPenTiltX(); + unsigned char* GetPenTiltY(); +}; + diff --git a/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj b/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj new file mode 100644 index 0000000..3e01c8c --- /dev/null +++ b/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj.virtual-7-64.entwickler.user b/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj.virtual-7-64.entwickler.user new file mode 100644 index 0000000..eef3b04 --- /dev/null +++ b/PaperInkConverter/PaperInkConverter/PaperInkConverter.vcproj.virtual-7-64.entwickler.user @@ -0,0 +1,65 @@ + + + + + + + + + + + diff --git a/PaperInkConverter/PaperInkConverter/ReadMe.txt b/PaperInkConverter/PaperInkConverter/ReadMe.txt new file mode 100644 index 0000000..a1d82e3 --- /dev/null +++ b/PaperInkConverter/PaperInkConverter/ReadMe.txt @@ -0,0 +1,22 @@ +======================================================================== + STATIC LIBRARY : PaperInkConverter Project Overview +======================================================================== + +AppWizard has created this PaperInkConverter library project for you. + +No source files were created as part of your project. + + +PaperInkConverter.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/PaperInkRecognizer/GeneralInkRecognizer/AnalyzerCommunication.h b/PaperInkRecognizer/GeneralInkRecognizer/AnalyzerCommunication.h new file mode 100644 index 0000000..d39f356 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/AnalyzerCommunication.h @@ -0,0 +1,67 @@ +#pragma once + +// includes for the 64 Bit / 32 Bit Analyzer communication + +typedef enum InkAnalyzerResult { + AnalyzingReady = 0, + AnalyzerResultAvailable, + LineBoxes, + BulletBoxes, + InkDrawingBoxes, + InkAnalyzeFinished, + InkAnalyzerUnadvise, + FinischInkAnalyzerListener +}; + +typedef struct sCountInfo{ + ULONG LineBoxesCount; + ULONG BulletBoxesCount; + ULONG DrawinfBoxesCount; +}; + +typedef struct structLayoutBoxesCounts { + long command; + sCountInfo CountInfo; +}; + +enum AnalyzerCommand { + AnalyzeStrokes = 1, + AddAnalyzerStroke, + SearchUpperLeftLinePosition, + GetLineBoxInfo, + GetBulletPosition, + GetDrawingHotspots, + ClearAllAnalyzerStrokes, + AdviseInkAnylyzer, + UnanadviseInkAnylyzer, + FinishInkAnylyzer +}; + +struct sPointsInfo{ + long X_MinValue_Left; + long X_MinValue_Right; + long Y_MinValue_Top; + long Y_MinValue_Bottom; +}; +struct sLineBoxInfo{ + int Left; + int Top; + int width; + int height; + int RecognizedStringSize; +}; + +struct sBulletBoxInfo{ + int Left; + int Top; + int width; + int height; +}; + +struct sDrawingBoxInfo{ + int Left; + int Top; + int width; + int height; + int RecognizedStringSize; + }; diff --git a/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.cpp b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.cpp new file mode 100644 index 0000000..dd1fb25 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.cpp @@ -0,0 +1,1116 @@ +/********************************************************************************** + * copyright : (C) 2012 by Herbert Ellebruch + * email : herbert@useful-tools.de + + ********************************************************************************** + * This file is part of PaperInkRecognizer. * + * * + * PaperInkRecognizer is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * Foobar is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with PaperInkRecognizer. If not, see . * + * * + *********************************************************************************/ + +// : Defines the exported functions for the DLL application. +#ifdef GENERALINKANALYZER_EXPORTS +#define PAPERINKANALYZER_API extern "C" __declspec(dllexport) +#else +#define PAPERINKANALYZER_API extern "C" __declspec(dllimport) +#endif + +#include +#include +#include + +// Headers for Tablet PC Automation interfaces +// Headers Included in Tablet PC SDK 1.7 +#include +#include + +#include + +// Headers for the Tablet PC Ink Analysis interfaces +#include +#include +#include +#include + + +#include +#include + + +// #define MathInput TODO +#ifdef MathInput + #include "micaut.h" + #include "micaut_i.c" +#endif + +#include "PaperInkConverter.h" +#include "InkEvents.h" +#ifdef ExternAnalyzer +#include "AnalyzerCommunication.h" +#endif +#include "GeneralInkRecognizer.h" + +/// +/// +// Managed Wrapper Functions +// for PaperInkConverter +PaperInkConverter* InitPaperInkReader(wchar_t* FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold) +{ + return new PaperInkConverter(FileName,RelativThreshold,AbsoluteThreshold,SlidingThreshold); +} + +int EOFfound(PaperInkConverter* pPaperInkConverter) { + return(pPaperInkConverter->EOF_Found()); +} +/// +// Wrapper for Analyzer Class +PaperInkAnalyzer* NewPaperInkAnalyzer( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + HWND DrawingHandle) { + return (new PaperInkAnalyzer( + InkAnalyzerResultAvailableFunction, + InkInkDrawingInfoFunction, + InkLineBoxInfoFunction, + InkBulletInfoFunction, + AnalyserHasFinishedFunction, + MathPanelReplyFunction, + DrawingHandle)); +}; + +int DeletePaperInkAnalyzer(PaperInkAnalyzer* aPaperInkAnalyzer) { + delete aPaperInkAnalyzer; + return(0); +}; + +int StrokesToMathInputPanel(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->SendAllStrokesToMathInputPanel(); +}; + +int AnalyzeInk(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->AnalyzeInk(); +}; + +int AddStrokesFromFile(PaperInkAnalyzer* aPaperInkAnalyzer,PaperInkConverter* pPaperInkConverter, long StrokeColorARGB) { + long StrokeColorRGB; + // Convert Color from ARGB to RGB + char* src = ((char*)&StrokeColorARGB)+2; + char* dst = ((char*)&StrokeColorRGB); + *dst++ = *src--; + *dst++ = *src--; + *dst++ = *src--; + *dst++ = 0; + return aPaperInkAnalyzer->AddStrokesFromFile(pPaperInkConverter, StrokeColorRGB); +}; + +int DeleteAllStrokes(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->DeleteAllStrokes(); +}; + +int PositioningInkPanel(PaperInkAnalyzer* aPaperInkAnalyzer, int Basic_X_Offset, int Basic_Y_Offset, HWND HorizontalScrollHandle, HWND VerticalScrollHandle) +{ + return aPaperInkAnalyzer->PositioningInkPanel(Basic_X_Offset, Basic_Y_Offset, HorizontalScrollHandle, VerticalScrollHandle); +}; + +int CopyToClipboard(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->CopyToClipboard(); +}; +#ifdef NoCallback +int WrapFindUpperLeftLinePosition(PaperInkAnalyzer* aPaperInkAnalyzer, int* Min_X_Position_Left, int* Min_X_Position_Right, int* Min_Y_Position_TOP, int* Min_Y_PositionBottom) { + return aPaperInkAnalyzer->FindUpperLeftLinePosition(Min_X_Position_Left, Min_X_Position_Right,Min_Y_Position_TOP ,Min_Y_PositionBottom); +}; + +int GetInkBullets(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->GetInkBullets(); +}; + +int GetNextInkBulletsInfo(PaperInkAnalyzer* aPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height ) { + return aPaperInkAnalyzer->GetNextInkBulletsInfo(BoxIndex, Left, Top, width, height ); +}; + +int GetInkLineBoxes(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->GetInkLineBoxes(); +}; + +int GetNextInkLineBoxInfo(PaperInkAnalyzer* aPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ) { + return aPaperInkAnalyzer->GetNextInkLineBoxInfo(BoxIndex, Left, Top, width, height, pText ); +}; + +int GetInkDrawingBoxes(PaperInkAnalyzer* aPaperInkAnalyzer) { + return aPaperInkAnalyzer->GetInkDrawingBoxes(); +}; + +int GetNextInkInkDrawingHotSpots(PaperInkAnalyzer* aPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ) { + return aPaperInkAnalyzer->GetNextInkInkDrawingHotSpots(BoxIndex, Left, Top, width, height, pText ); +} +#endif + + +#ifdef ExternAnalyzer +void PaperInkAnalyzer::AddStrokeToAnalyzer( IInkStrokeDisp* pIInkStroke) { +{ + VARIANT varPacketData; + HRESULT hr = pIInkStroke->GetPacketData( + ISC_FirstElement, + ISC_AllElements, + &varPacketData); // Packet Data of the Stroke + if( SUCCEEDED(hr) ) + { + // Get the stroke id + long id; + hr = pIInkStroke->get_ID(&id); + if( SUCCEEDED(hr) ) + { + // Get the packet description + VARIANT varPacketDesc; + hr = pIInkStroke->get_PacketDescription(&varPacketDesc); + if( SUCCEEDED(hr) ) + { + LONG * plPacketData = NULL; + BSTR * pbstrPacketDesc = NULL; + + hr = ::SafeArrayAccessData( + varPacketData.parray, + (void **)&plPacketData); + // plPacketData pointer to the packet data + if( SUCCEEDED(hr) ) + { + hr = ::SafeArrayAccessData( + varPacketDesc.parray, + (void **)&pbstrPacketDesc); + } + // pbstrPacketDesc pointer to the packet descriptor + + if( SUCCEEDED(hr) ) + { + ULONG guidCount = varPacketDesc.parray->rgsabound[0].cElements; + ULONG packetDataCount = varPacketData.parray->rgsabound[0].cElements; + // 1* ULONG ID + // 2* ULONG Counter +/* + GUID *pPacketDescGuids = new GUID[guidCount]; + // needed memory + // 3 * ULONG + // + guidCount* sizeof(GUID) + // + packetDataCount + // Memeory Layout + // ULONG + // ULONG + // GUIDS + // Packet Data + if( NULL == pPacketDescGuids ) + { + hr = E_OUTOFMEMORY; + } +*/ + char* m_Pipe = (char*) malloc(sizeof(AnalyserStrokeInfo) + guidCount*sizeof(GUID)+ packetDataCount*sizeof(LONG)); + ((AnalyserStrokeInfo*)m_Pipe)->Command = AddAnalyzerStroke; + ((AnalyserStrokeInfo*)m_Pipe)->id = id; + ((AnalyserStrokeInfo*)m_Pipe)->packetDataCount = packetDataCount; + ((AnalyserStrokeInfo*)m_Pipe)->guidCount = guidCount; + + GUID* ptempPacketDescGuids = (GUID*)(m_Pipe + sizeof(AnalyserStrokeInfo)); + memcpy(m_Pipe+sizeof(AnalyserStrokeInfo) + guidCount*sizeof(GUID),plPacketData, packetDataCount*sizeof(LONG)); + if( SUCCEEDED(hr) ) + { + for( ULONG ul = 0; ul < guidCount; ul++ ) + { + ::CLSIDFromString( + pbstrPacketDesc[ul], + &ptempPacketDescGuids[ul]); // pointer to the GUIDS memory + } + DWORD ByteWritten; + // Send Stroke to external Analyzer + WriteFile(hWriteChild,m_Pipe, sizeof(AnalyserStrokeInfo) + guidCount*sizeof(GUID)+ packetDataCount*sizeof(LONG), &ByteWritten,NULL); + } + free(m_Pipe); + } + ::SafeArrayUnaccessData(varPacketDesc.parray); + ::SafeArrayUnaccessData(varPacketData.parray); + } + } + } + VariantClear(&varPacketData); + + } +} +#else +void PaperInkAnalyzer::AddStrokeToAnalyzer( IInkStrokeDisp* pIInkStroke) { +{ + VARIANT varPacketData; + HRESULT hr = pIInkStroke->GetPacketData( + ISC_FirstElement, + ISC_AllElements, + &varPacketData); // Packet Data of the Stroke + if( SUCCEEDED(hr) ) + { + // Get the stroke id + long id; + hr = pIInkStroke->get_ID(&id); + if( SUCCEEDED(hr) ) + { + // Get the packet description + VARIANT varPacketDesc; + hr = pIInkStroke->get_PacketDescription(&varPacketDesc); + if( SUCCEEDED(hr) ) + { + LONG * plPacketData = NULL; + BSTR * pbstrPacketDesc = NULL; + + hr = ::SafeArrayAccessData( + varPacketData.parray, + (void **)&plPacketData); + // plPacketData pointer to the packet data + if( SUCCEEDED(hr) ) + { + hr = ::SafeArrayAccessData( + varPacketDesc.parray, + (void **)&pbstrPacketDesc); + } + // pbstrPacketDesc pointer to the packet descriptor + + if( SUCCEEDED(hr) ) + { + ULONG guidCount = varPacketDesc.parray->rgsabound[0].cElements; + ULONG packetDataCount = varPacketData.parray->rgsabound[0].cElements; + // 1* ULONG ID + // 2* ULONG Counter + GUID *pPacketDescGuids = new GUID[guidCount]; + // needed memory + // 3 * ULONG + // + guidCount* sizeof(GUID) + // + packetDataCount + // Memeory Layout + // ULONG + // ULONG + // GUIDS + // Packet Data + if( NULL == pPacketDescGuids ) + { + hr = E_OUTOFMEMORY; + } + if( SUCCEEDED(hr) ) + { + for( ULONG ul = 0; ul < guidCount; ul++ ) + { + ::CLSIDFromString( + pbstrPacketDesc[ul], + &pPacketDescGuids[ul]); // pointer to the GUIDS memory + } + IContextNode* spNode = NULL; + hr = m_spIInkAnalyzer->AddStroke( + id, + packetDataCount, + plPacketData, + guidCount, + pPacketDescGuids, + &spNode); + + } + delete [] pPacketDescGuids; + } + + + + ::SafeArrayUnaccessData(varPacketDesc.parray); + ::SafeArrayUnaccessData(varPacketData.parray); + } + } + } + VariantClear(&varPacketData); + } +} +#endif + +int PaperInkAnalyzer::SendAllStrokesToMathInputPanel() { +#ifdef MathInput + HRESULT hr; + if (!MathInputPanelOpen) { + MathInputPanelOpen = true; + HRESULT hr = CoInitialize(NULL); + + hr = CoCreateInstance(CLSID_MathInputControl, + NULL, CLSCTX_INPROC_SERVER, + IID_IMathInputControl, + (void **) &g_spMIC); + hr = g_spMIC->EnableExtendedButtons(VARIANT_TRUE); + hr = g_spMIC->Show(); + } + hr = g_spMIC->LoadInk( g_pIInkDisp ); + + + hr = m_MathInputEvents.Init(g_pMainWindowHandle); + // Set up connection between Math Input Panel and our event sink + hr = m_MathInputEvents.AdviseMathInputPanel(g_spMIC); + + + + return(MANAGED_TRUE); +#else + return(MANAGED_FALSE); +#endif + +} +int PaperInkAnalyzer::AnalyzeInk() { + IAnalysisStatus* status; + +#ifdef ExternAnalyzer + { + int Command = ClearAllAnalyzerStrokes; + // Unadvise and Advise is done automaticly + DWORD ByteWritten; + WriteFile(hWriteChild,&Command, sizeof(Command), &ByteWritten,NULL); + } + HRESULT hr; +#else + HRESULT hr = m_InkAnalyserEvents.UnadviseInkAnalyzer(); + m_spIInkAnalyzer->Release(); + hr = CoCreateInstance(CLSID_InkAnalyzer, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkAnalyzer, + (void **) &m_spIInkAnalyzer); +if (FAILED(hr)) + int kkkk = 0;// return -1; +#endif + + + +#ifdef ExternAnalyzer + // not needed at this place may be later for more functionality +#else + // Set up connection between Ink Analyser and our event sink + hr = m_InkAnalyserEvents.AdviseInkAnalyser(m_spIInkAnalyzer); + + // Set the analysis mode to do autoreconciliation and personlization + hr = m_spIInkAnalyzer->SetAnalysisModes((AnalysisModes) AnalysisModes_AutomaticReconciliation ); +#endif + + + + IInkStrokes* m_spIInkCustomStrokes; + hr = g_pIInkDisp->get_Strokes(&m_spIInkCustomStrokes); + + long NumberOfStrokes; + hr = m_spIInkCustomStrokes->get_Count(&NumberOfStrokes); + + for (int icount=0;icountItem(icount,&pIInkStroke); + AddStrokeToAnalyzer( pIInkStroke); + pIInkStroke->Release(); + } + hr = m_spIInkCustomStrokes->Release(); + +#ifdef ExternAnalyzer + int Command = (int) AnalyzeStrokes; + DWORD ByteWritten; +#ifdef NoAnalyzerCallback + WriteFile(hWriteChild,&Command, sizeof(int), &ByteWritten,NULL); + ReadFile(hReadChild,&LayoutBoxesCounts,sizeof(structLayoutBoxesCounts),&NumberOfBytesIn,NULL); +#else + WriteFile(hWriteChild,&Command, sizeof(int), &ByteWritten,NULL); // start BackgroundAnalyze +#endif +#else + // hr = m_spIInkAnalyzer->Analyze(&status); + hr = m_spIInkAnalyzer->BackgroundAnalyze(); + if (FAILED(hr)) + int test = 1;//return -1; +#endif + return(MANAGED_TRUE); +} + +int PaperInkAnalyzer::AddStrokesFromFile(PaperInkConverter* m_pPaperInkConverter, long StrokeColor) { + + VARIANT var, varPK; + LONG* plongArray=NULL; + VariantInit( &var ); + VariantInit( &varPK ); + + int StrokeFound = 0; // Mark we have a stroke + + SECURITY_ATTRIBUTES lsa; + + int nSize = 0; + + lsa.nLength=sizeof(SECURITY_ATTRIBUTES); + lsa.lpSecurityDescriptor=NULL; + lsa.bInheritHandle=TRUE; + +#ifdef ForTestOnlyTODO +// NewAttributes->put_Color(RGB(0xff,0,0)); +int sehen1 = RGB(0xff,0,0); +int sehen2 = StrokeColor & RGB(0xff,0xFF,0xFF); + +typedef struct sColorRGB{ + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char unused; +} ColorRGB; + + + +struct sColorARGB{ + unsigned char b; + unsigned char g; + unsigned char r; + unsigned char alpha; +} ColorARGB; + +sColorRGB dest; +dest.r = ((ColorARGB)StrokeColor).r; +dest.g = ((ColorARGB)StrokeColor).g; +dest.b = ((ColorARGB)StrokeColor).b; +dest.unused = 0; + +int ConvertedColor; +char* src = ((char*)&StrokeColor)+2; +char* dst = ((char*)&ConvertedColor); +*dst++ = *src--; +*dst++ = *src--; +*dst++ = *src--; +*dst++ = 0; +#endif + + + IInkDrawingAttributes* NewAttributes; + HRESULT hr = g_pIInkCollector->get_DefaultDrawingAttributes(&NewAttributes);// TODO Wrong Place + + //NewAttributes->put_IgnorePressure(VARIANT_FALSE); + NewAttributes->put_Color(StrokeColor);// TODO Wrong Place + NewAttributes->put_Height(20); + NewAttributes->put_Width(20); + hr = g_pIInkCollector->putref_DefaultDrawingAttributes(NewAttributes); + + while (StrokeFound == 0) + { + long lSize=m_pPaperInkConverter->GetNumberOfPoints();; + SAFEARRAY* psa = SafeArrayCreateVector( VT_I4, 0, lSize*2 ); + if( psa ) + { + if( SUCCEEDED( hr = SafeArrayAccessData( psa, (void**)&plongArray) )) + { + short* actualStroke_X = m_pPaperInkConverter->GetPenPositionX(); + short* actualStroke_Y = m_pPaperInkConverter->GetPenPositionY(); + for( long i = 0; i < lSize; i++ ) + { + + plongArray[2*i] = ((int)*actualStroke_X) + 12000; // TODO Change constant + plongArray[2*i+1] = (((int)*actualStroke_Y)) + 1900; // TODO Change constant + actualStroke_X++; + actualStroke_Y++; + } + hr = SafeArrayUnaccessData( psa ); + + if ( SUCCEEDED( hr ) ) + { + var.vt = VT_ARRAY | VT_I4; + var.parray = psa; + + // varPK (packet description) is currently reserved, so it is + // just empty variant for now. + IInkStrokeDisp * pIInkStroke; + hr = g_pIInkDisp->CreateStroke(var,varPK,&pIInkStroke); + hr = pIInkStroke->putref_DrawingAttributes(NewAttributes);// TODO clipboardfly different colors will be added later + + AddStrokeToAnalyzer( pIInkStroke); + hr = pIInkStroke->Release(); + } + } + } + StrokeFound = m_pPaperInkConverter->ReadNextStroke(); + + } + VariantClear( &var ); + VariantClear( &varPK ); + NewAttributes->Release(); + +#ifdef ExternAnalyzer + int Command = (int) AnalyzeStrokes; + DWORD ByteWritten; +#ifdef NoAnalyzerCallback + DWORD NumberOfBytesIn; + WriteFile(hWriteChild,&Command, sizeof(int), &ByteWritten,NULL); + ReadFile(hReadChild,&LayoutBoxesCounts,sizeof(structLayoutBoxesCounts),&NumberOfBytesIn,0); +#else + WriteFile(hWriteChild,&Command, sizeof(int), &ByteWritten,NULL); +#endif +#else + hr = m_spIInkAnalyzer->BackgroundAnalyze(); + if (FAILED(hr)) + return MANAGED_FALSE; +#endif + return(MANAGED_TRUE); +} + + +PaperInkAnalyzer::PaperInkAnalyzer( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + HWND DrawingHandle) { + // initialize the Class Variables + + PreviousVerticalShiftPos = 0; + PreviousVerticalShiftPosFloat = 0; + + PreviousHorizontalShiftPos = 0; + PreviousHorizontalShiftPosFloat = 0; + +#ifdef MathInput +// TODO + MathInputPanelOpen = false; + g_pMainWindowHandle = (HWND) DrawingHandle; +#endif + + // Create the InkCollector object. + HRESULT hr = CoCreateInstance(CLSID_InkCollector, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkCollector, + (void **) &g_pIInkCollector); + if (FAILED(hr)) + int test = 1;// return -1; + InkCollectorEventInterest TODOeventtest = ICEI_NewPackets; + // Get a pointer to the Ink object + hr = g_pIInkCollector->get_Ink(&g_pIInkDisp); + g_pIInkCollector->SetEventInterest(TODOeventtest,VARIANT_TRUE); + if (FAILED(hr)) + int test = 1;// return -1; + hr = g_pIInkCollector->get_Renderer(&g_pInkRenderer); + g_pInkRenderer->ScaleTransform(1.08,1.08);// TODO Check Variables + +#ifdef StrokeEvents + hr = m_InkEvents.Init((HWND) DrawingHandle); + // Set up connection between Ink Collector and our event sink + hr = m_InkEvents.AdviseInkCollector(g_pIInkCollector); +#endif + +/* TODO Error Handling + if (FAILED(hr)) + { + return hr; + } +*/ + +#ifdef ExternAnalyzer +// Example for ink layout +// http://msdn.microsoft.com/en-us/library/windows/desktop/ms704040(v=vs.85).aspx + + BOOL Success; + SECURITY_ATTRIBUTES lsa; + STARTUPINFOA si; + PROCESS_INFORMATION pi; + + lsa.nLength=sizeof(SECURITY_ATTRIBUTES); + lsa.lpSecurityDescriptor=NULL; + lsa.bInheritHandle=TRUE; + + + // + // Create Parent_Write to ChildStdIn Pipe. Then + // duplicate the parent copy to a noninheritable + // handle and close the inheritable one so that + // the child won't be holding open a handle to + // the server end of its stdin pipe when we try + // to nuke that pipe to close the child. + // + + int nSize = 0; + Success = CreatePipe( + &ChildIn, // read handle + &hWriteChild, // write handle + &lsa, // security attributes + nSize // pipe size + ); + + Success = CreatePipe( + &hReadChild, // read handle + &ChildOut, // write handle + &lsa, // security attributes + nSize // pipe size + ); + + SetHandleInformation(hWriteChild,HANDLE_FLAG_INHERIT,0); + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(STARTUPINFOA); + si.dwFlags = STARTF_USESTDHANDLES; + si.hStdInput = ChildIn; // ReadPipeHandle + si.hStdOutput = ChildOut; // WritePipeHandle + si.hStdError = 0; + si.wShowWindow = SW_SHOW; + + // + // Create Child Process + + char buffer[512]; + DWORD DLL_FileLength = GetModuleFileNameA( GetModuleHandle(RECOGNIZER_FULLDLLNAME ), buffer, sizeof(buffer) ) - 1; + char* pDLL_Name = &buffer[DLL_FileLength]; + while(DLL_FileLength > 0) { + if (*pDLL_Name == L'\\') + { + pDLL_Name++; + break; + } + DLL_FileLength--; + pDLL_Name--; + } + + +#ifdef DebugDLL +// old Version strcpy(pDLL_Name,"..\\..\\..\\..\\InkAnalyser32\\Debug\\InkAnalyser32.exe"); + strcpy(pDLL_Name,"..\\..\\..\\InkAnalyser32\\Debug\\InkAnalyser32.exe"); +// \PaperInkRecognizer\InkAnalyser32\Debug +#else + strcpy(pDLL_Name,"InkAnalyser32.exe"); +#endif + + + BOOL res = CreateProcessA(NULL, // module name + buffer, // Command Name + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + TRUE, //FALSE, // Set handle inheritance + CREATE_NO_WINDOW, // . + NULL, // Do not use parent's environment block. + NULL, // Do not use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ); // Pointer to PROCESS_INFORMATION structure. + if ( !res) { + MessageBoxA(NULL,"Sending Modul not available","Fatal Error",MB_ICONWARNING); + } else { + + WaitForInputIdle( pi.hProcess, 8000); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + m_InkAnalyserEvents.Init (hReadChild); + m_InkAnalyserEvents.SetCallbacks( + InkAnalyzerResultAvailableFunction, + InkInkDrawingInfoFunction, + InkLineBoxInfoFunction, + InkBulletInfoFunction, + AnalyserHasFinishedFunction); + } + + +#else + // Create an ink analyzer object. + hr = CoCreateInstance(CLSID_InkAnalyzer, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkAnalyzer, + (void **) &m_spIInkAnalyzer); + + + if (FAILED(hr)) + int test = 1;//return -1;// todo Insert Error Handling + + hr = m_InkAnalyserEvents.Init( DrawingHandle); + // Set up connection between Ink Analyser and our event sink + m_InkAnalyserEvents.SetCallbacks( + InkAnalyzerResultAvailableFunction, + InkInkDrawingInfoFunction, + InkLineBoxInfoFunction, + InkBulletInfoFunction, + AnalyserHasFinishedFunction); +// TODO for Test only MathPanelReply MathPanelReplyFunction + + + hr = m_InkAnalyserEvents.AdviseInkAnalyser(m_spIInkAnalyzer); + + // Set the analysis mode to do autoreconciliation and personlization + // hr = m_spIInkAnalyzer->SetAnalysisModes((AnalysisModes) AnalysisModes_Personalization ); + hr = m_spIInkAnalyzer->SetAnalysisModes((AnalysisModes) AnalysisModes_AutomaticReconciliation ); + + if (FAILED(hr)) + { + int Test = 1;// int return hr;// todo Insert Error Handling + } + +#endif + +// Enable ink input in the m_wndInput window + hr = g_pIInkCollector->put_hWnd((long)DrawingHandle); + if (FAILED(hr)) + int test = 1;//return -1; + hr = g_pIInkCollector->put_Enabled(VARIANT_TRUE); + if (FAILED(hr)) + int test = 1;//return -1; +} + +PaperInkAnalyzer::~PaperInkAnalyzer() { + { +#ifdef ExternAnalyzer + int Command = FinishInkAnylyzer; + DWORD ByteWritten; + WriteFile(hWriteChild,&Command, sizeof(Command), &ByteWritten,NULL); + // hReadChild is closed in the thread + BOOL temp = CloseHandle(hWriteChild); + temp = CloseHandle(ChildOut); + temp = CloseHandle(ChildIn); +#else + m_InkAnalyserEvents.UnadviseInkAnalyzer(); + m_spIInkAnalyzer->Release(); +#endif + g_pInkRenderer->Release(); + g_pIInkDisp->Release(); + g_pIInkCollector->Release(); + } + +}; + +int PaperInkAnalyzer::DeleteAllStrokes() { + HRESULT hr = g_pIInkDisp->DeleteStrokes(0); +#ifdef ExternAnalyzer + // Unadvise and Advise is done automaticly + int Command = ClearAllAnalyzerStrokes; + DWORD ByteWritten; + DWORD NumberOfBytesIn; + WriteFile(hWriteChild,&Command, sizeof(int), &ByteWritten,NULL); +#else + hr = m_InkAnalyserEvents.UnadviseInkAnalyzer(); + m_spIInkAnalyzer->Release(); + hr = CoCreateInstance(CLSID_InkAnalyzer, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkAnalyzer, + (void **) &m_spIInkAnalyzer); + if (FAILED(hr)) + int kk = 0;// todo Insert Error Handling +#endif + + +#ifdef ExternAnalyzer + // not needed at this place may be later for more functionality +#else + hr = m_InkAnalyserEvents.AdviseInkAnalyser(m_spIInkAnalyzer); + + // Set the analysis mode to do autoreconciliation and personlization + // hr = m_spIInkAnalyzer->SetAnalysisModes((AnalysisModes) AnalysisModes_Personalization ); + hr = m_spIInkAnalyzer->SetAnalysisModes((AnalysisModes) AnalysisModes_AutomaticReconciliation ); +#endif + return(MANAGED_TRUE); +} + +int PaperInkAnalyzer::CopyToClipboard() { + + // IInkStrokes* theStrokes; + // InkClipboardFormats tempFormats = (InkClipboardFormats) (ICF_InkSerializedFormat | ICF_SketchInk | ICF_TextInk); + // InkClipboardModes c; + IDataObject* tempDataObject; + // g_pIInkDisp->ClipboardCopy(a,b,c,&d); + HRESULT hrxy = g_pIInkDisp->ClipboardCopy(NULL,ICF_Default, ICB_Copy,&tempDataObject); + tempDataObject->Release(); + return(MANAGED_TRUE); +} + +int PaperInkAnalyzer::PositioningInkPanel(int Basic_X_Offset, int Basic_Y_Offset, HWND HorizontalScrollHandle, HWND VerticalScrollHandle) +{ + // Get the renderer from the ink collector's ink object + IInkRenderer* spInkRenderer; + HRESULT hr = g_pIInkCollector->get_Renderer(&spInkRenderer); + int ActualVerticalShiftPos = - (Basic_Y_Offset + GetScrollPos(VerticalScrollHandle,SB_VERT) * 27 ); + int ActualHorizontalShiftPos = - (Basic_X_Offset + GetScrollPos(HorizontalScrollHandle,SB_CTL) * 27 ); + + if ((ActualVerticalShiftPos != PreviousVerticalShiftPos) || (ActualHorizontalShiftPos != PreviousHorizontalShiftPos)) { + + float temp1 = Basic_Y_Offset * 1.055; + float temp2 = GetScrollPos(VerticalScrollHandle,SB_VERT) * 27 ;// todo + float ActualVerticalShiftPosFloat = -(temp1 + temp2); + + temp1 = Basic_X_Offset * 1.055; + temp2 = GetScrollPos(HorizontalScrollHandle,SB_CTL) * 27 * 8 ;// todo +// spInkRenderer->Move(0.,(float)(ActualVerticalShiftPos - PreviousShiftPos) ); +// hr = spInkRenderer->Move(0.,(ActualVerticalShiftPosFloat - PreviousVerticalShiftPosFloat )); + float ActualHorizontalShiftPosFloat = -(temp1 + temp2); + hr = spInkRenderer->Move((ActualHorizontalShiftPosFloat - PreviousHorizontalShiftPosFloat),(ActualVerticalShiftPosFloat - PreviousVerticalShiftPosFloat )); + + PreviousVerticalShiftPos = ActualVerticalShiftPos; + PreviousVerticalShiftPosFloat = ActualVerticalShiftPosFloat; + + PreviousHorizontalShiftPos = ActualHorizontalShiftPos; + PreviousHorizontalShiftPosFloat = ActualHorizontalShiftPosFloat; + } + return MANAGED_TRUE; +}; + + +// Application Spezific Ink Events +// Event: Stroke +void CMyInkEvents::Stroke( + IInkCursor* Cursor, + IInkStrokeDisp* Stroke, + VARIANT_BOOL *Cancel) +{ + // Demonstrate that we received the event notification. + MessageBox(m_hWnd, TEXT("Stroke Event"), TEXT("Event Received"), MB_OK); +#ifdef TODO_Test + VARIANT Punkte; + Stroke->GetPoints(ISC_FirstElement,ISC_AllElements,&Punkte); +#endif + int gucken = 9; +} + +CMyInkEvents::CMyInkEvents() +{ + m_hWnd = NULL; +} + +HRESULT CMyInkEvents::Init( + HWND hWnd) +{ + m_hWnd = hWnd; + return InkCollectorEvents::Init(); +} + +// Application Spezific Ink Analyzer Events +#ifdef ExternAnalyzer + void CMyInkAnalyserEvents::ReceiveInkAnalyzerResult() {// todo rename in ResultsUpdated + bool AnalyzerThreadRunning = true; + while (AnalyzerThreadRunning) { + int x = 1; + DWORD NumberOfBytesIn; + int Command; + ReadFile(hReadChild,&Command,sizeof(Command),&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != sizeof(Command)) { + break; + } + + switch (Command) { + case AnalyzingReady: + + { + DWORD NumberOfBytesIn; + sCountInfo LayoutBoxesCounts; + ReadFile(hReadChild,&LayoutBoxesCounts,sizeof(sCountInfo),&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != sizeof(sCountInfo)) { + AnalyzerThreadRunning = false; + break; + } + LineBoxesCount = 0; + BulletBoxesCount = 0; + DrawinfBoxesCount = 0; + } + break; + + case AnalyzerResultAvailable: + { + // TODO rename it in InkanalysesStarted + int Success = (*InkAnalyzerResultAvailableFunction) ( ); + } + break; + + case LineBoxes: + { + DWORD NumberOfBytesIn; + sLineBoxInfo LineBoxesInfo; + ReadFile(hReadChild, &LineBoxesInfo, sizeof(LineBoxesInfo) ,&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != sizeof(LineBoxesInfo)) { + AnalyzerThreadRunning = false; + break; + } + BYTE* pLineString = (BYTE*) malloc(LineBoxesInfo.RecognizedStringSize+1); + ReadFile(hReadChild, pLineString,LineBoxesInfo.RecognizedStringSize+1,&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != (LineBoxesInfo.RecognizedStringSize+1)) { + AnalyzerThreadRunning = false; + break; + } + + int Success = (*InkLineBoxInfoFunction) ( LineBoxesInfo.Left , LineBoxesInfo.Top , LineBoxesInfo.width , LineBoxesInfo.height, (char*) pLineString); + free(pLineString); + + } + break; + + case BulletBoxes: + { + DWORD NumberOfBytesIn; + sBulletBoxInfo BulletBoxesInfo; + ReadFile(hReadChild, &BulletBoxesInfo, sizeof(BulletBoxesInfo) ,&NumberOfBytesIn,NULL); + int Success = (*InkBulletInfoFunction) ( BulletBoxesInfo.Left , BulletBoxesInfo.Top , BulletBoxesInfo.width , BulletBoxesInfo.height); + } + break; + + case InkDrawingBoxes: + { + DWORD NumberOfBytesIn; + sDrawingBoxInfo DrawingBoxHotspots; + ReadFile(hReadChild, &DrawingBoxHotspots, sizeof(DrawingBoxHotspots) ,&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != sizeof(DrawingBoxHotspots)) { + AnalyzerThreadRunning = false; + break; + } + BYTE* pLineString = (BYTE*) malloc(DrawingBoxHotspots.RecognizedStringSize+1); + ReadFile(hReadChild, pLineString,DrawingBoxHotspots.RecognizedStringSize+1,&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != (DrawingBoxHotspots.RecognizedStringSize+1)) { + AnalyzerThreadRunning = false; + break; + } + + int Success = (*InkInkDrawingInfoFunction) ( DrawingBoxHotspots.Left , DrawingBoxHotspots.Top , DrawingBoxHotspots.width , DrawingBoxHotspots.height, (char*) pLineString); + free(pLineString); + } + break; + + case InkAnalyzeFinished: + { + sPointsInfo UpperPositionPoints; + DWORD NumberOfBytesIn; + ReadFile(hReadChild,&UpperPositionPoints,sizeof(UpperPositionPoints),&NumberOfBytesIn,NULL); + if (NumberOfBytesIn != sizeof(UpperPositionPoints)) { + AnalyzerThreadRunning = false; + break; + } + int Success = (*AnalyserHasFinishedFunction) ( UpperPositionPoints.X_MinValue_Left , UpperPositionPoints.X_MinValue_Right , UpperPositionPoints.Y_MinValue_Top , UpperPositionPoints.Y_MinValue_Bottom); + } + break; + case FinischInkAnalyzerListener: + { + BOOL temp = CloseHandle(hReadChild); + hReadChild = NULL; + AnalyzerThreadRunning = false; + } + break; + } + } + if (hReadChild != NULL) { + BOOL temp = CloseHandle(hReadChild); // close the read handle if not yet done + } + } +#else +HRESULT STDMETHODCALLTYPE CMyInkAnalyserEvents::ResultsUpdated( + IInkAnalyzer* pInkAnalyzer, + IAnalysisStatus* pAnalysisStatus) { +#ifdef onlyForTesting + VARIANT_BOOL bResult = VARIANT_FALSE; + HRESULT hrT = pAnalysisStatus->IsSuccessful(&bResult); + + if( SUCCEEDED(hrT) && (VARIANT_TRUE == bResult) ) + { + // Get the top result string + int x = 8; + BSTR bstrTest = NULL; + hr = pInkAnalyzer->GetRecognizedString(&bstrTest); + int xui = 5; + } +#endif + int Success = (*InkAnalyzerResultAvailableFunction) ( ); + + + IContextNodes *pLineContextNodesfound; // received Line Nodes + HRESULT hr = pInkAnalyzer->FindNodesOfType(&GUID_CNT_LINE, &pLineContextNodesfound); + ULONG NumberOfLineNodes; + pLineContextNodesfound->GetCount(&NumberOfLineNodes); + if (NumberOfLineNodes != 0) { + long temp_X_MinValue_Left = LONG_MAX; + long temp_X_MinValue_Right = LONG_MAX; + long temp_Y_MinValue_Top = LONG_MAX; + long temp_Y_MinValue_Bottom = LONG_MAX; + for (int i = 0;iGetContextNode(i,&pLineNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation; + hr = pLineNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + + if ( bounds.left < temp_X_MinValue_Left) { + temp_X_MinValue_Left = bounds.left; + temp_X_MinValue_Right = bounds.right; + } + if ( bounds.top < temp_Y_MinValue_Top) { + temp_Y_MinValue_Top = bounds.top; + temp_Y_MinValue_Bottom = bounds.bottom; + } + spLocation->Release(); + + BYTE* pLineString; + ULONG NumberOfCharacterInLine; + hr = pLineNode->GetPropertyData(&GUID_CNP_RECOGNIZEDSTRING,&NumberOfCharacterInLine,&pLineString); + int Success = (*InkLineBoxInfoFunction) ( bounds.left , bounds.top , bounds.right - bounds.left , bounds.bottom - bounds.top, (char*) pLineString); + ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method + + } + + IContextNodes *pBulletContextNodesfound; // received Bullet Nodes + hr = pInkAnalyzer->FindNodesOfType(&GUID_CNT_INKBULLET, &pBulletContextNodesfound); + ULONG NumberOfBulletNodes; + hr = pBulletContextNodesfound->GetCount(&NumberOfBulletNodes);// TODO generate Error messsge + for (int i = 0;iGetContextNode(i,&pBulletNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation; + hr = pBulletNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + spLocation->Release(); + pBulletNode->Release(); + int Success = (*InkBulletInfoFunction) ( bounds.left , bounds.top , bounds.right - bounds.left , bounds.bottom - bounds.top); + } + pBulletContextNodesfound->Release(); + int Success = (*AnalyserHasFinishedFunction) ( temp_X_MinValue_Left, temp_X_MinValue_Right, temp_Y_MinValue_Top, temp_Y_MinValue_Bottom); + } else { + // ( int Min_X_Position_Left, int Min_X_Position_Right, int Min_Y_Position_TOP, int Min_Y_PositionBottom) + int Success = (*AnalyserHasFinishedFunction) ( 0 , 1 , 0 , 1); + } + pLineContextNodesfound->Release(); + return S_OK; + } + + CMyInkAnalyserEvents::CMyInkAnalyserEvents() + { + m_hWnd = NULL; + } + + HRESULT CMyInkAnalyserEvents::Init( + HWND hWnd) + { + m_hWnd = hWnd; + return S_OK; + } + + void CMyInkAnalyserEvents::SetCallbacks( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction_In, + InkInkDrawingInfo InkInkDrawingInfoFunction_In, + InkLineBoxInfo InkLineBoxInfoFunction_In, + InkBulletInfo InkBulletInfoFunction_In, + AnalyserHasFinished AnalyserHasFinishedFunction_In + // TODO for test only MathPanelReply MathPanelReplyFunction_In + ) + { + InkAnalyzerResultAvailableFunction = InkAnalyzerResultAvailableFunction_In; + InkInkDrawingInfoFunction = InkInkDrawingInfoFunction_In; + InkLineBoxInfoFunction = InkLineBoxInfoFunction_In; + InkBulletInfoFunction = InkBulletInfoFunction_In; + AnalyserHasFinishedFunction = AnalyserHasFinishedFunction_In; + // TODO for test only MathPanelReply MathPanelReplyFunction, + return; + } + +#endif \ No newline at end of file diff --git a/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.h b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.h new file mode 100644 index 0000000..e3d99f1 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.h @@ -0,0 +1,281 @@ +// The following ifdef block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the PAPERINKRECOGNIZER_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// PAPERINKANALYZER_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +#ifdef PAPERINKANALYZER_EXPORTS +#define PAPERINKANALYZER_API extern "C" __declspec(dllexport) +#else +#define PAPERINKANALYZER_API extern "C" __declspec(dllimport) +#endif + +#define MANAGED_TRUE 1 +#define MANAGED_FALSE 0 + + +typedef int (CALLBACK* InkAnalyzerResultAvailable) (); +typedef int (CALLBACK* InkInkDrawingInfo) (int Left, int Top, int width, int height, char* pText); +typedef int (CALLBACK* InkLineBoxInfo) (int Left, int Top, int width, int height, char* pText); +typedef int (CALLBACK* InkBulletInfo) (int Left, int Top, int width, int height); +typedef int (CALLBACK* AnalyserHasFinished) (int Left, int Top, int width, int height); +typedef int (CALLBACK* MathPanelReply) (); + +#define RECOGNIZER_FULLDLLNAME TEXT("GeneralInkRecognizer.dll") + +typedef struct AnalyserStrokeInfo { + int Command; + long id; + ULONG packetDataCount; + ULONG guidCount; +} ; + +class CMyInkEvents : public InkCollectorEvents +{ +public: + + // Event: Stroke + virtual void Stroke( + IInkCursor* Cursor, + IInkStrokeDisp* Stroke, + VARIANT_BOOL *Cancel); + + CMyInkEvents(); + + HRESULT Init( + HWND hWnd); + HWND m_hWnd; +}; + + +#ifdef ExternAnalyzer +LPTHREAD_START_ROUTINE InkAnalyzerReceiver(LPVOID lpv); + +class CMyInkAnalyserEvents +{ +private: + HANDLE hReadChild; +private: +// Pointer to callback Functions + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction; + InkInkDrawingInfo InkInkDrawingInfoFunction; + InkLineBoxInfo InkLineBoxInfoFunction; + InkBulletInfo InkBulletInfoFunction; + AnalyserHasFinished AnalyserHasFinishedFunction; + MathPanelReply MathPanelReplyFunction; +// Variables for internal use + ULONG LineBoxesCount; + ULONG BulletBoxesCount; + ULONG DrawinfBoxesCount; + +public: + void Init(HANDLE hReadChild_In) + { + hReadChild = hReadChild_In; + HANDLE AddressChangeThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InkAnalyzerReceiver, (LPVOID)this, 0, NULL); + }; + + void SetCallbacks( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction_In, + InkInkDrawingInfo InkInkDrawingInfoFunction_In, + InkLineBoxInfo InkLineBoxInfoFunction_In, + InkBulletInfo InkBulletInfoFunction_In, + AnalyserHasFinished AnalyserHasFinishedFunction_In + //TODO Test Only MathPanelReply MathPanelReplyFunction_In + ) + { + InkAnalyzerResultAvailableFunction = InkAnalyzerResultAvailableFunction_In; + InkInkDrawingInfoFunction = InkInkDrawingInfoFunction_In; + InkLineBoxInfoFunction = InkLineBoxInfoFunction_In; + InkBulletInfoFunction = InkBulletInfoFunction_In; + AnalyserHasFinishedFunction = AnalyserHasFinishedFunction_In; + // TODO Test Only MathPanelReply MathPanelReplyFunction, + return; + } + + void ReceiveInkAnalyzerResult() ; + +}; + +LPTHREAD_START_ROUTINE InkAnalyzerReceiver(LPVOID lpv) +{ + CMyInkAnalyserEvents* pCInkAnalyzerResults = (CMyInkAnalyserEvents*) lpv; + pCInkAnalyzerResults->ReceiveInkAnalyzerResult(); + return (0); +} +#else +class CMyInkAnalyserEvents : public InkAnalyserEvents +{ +public: + +virtual HRESULT STDMETHODCALLTYPE ResultsUpdated( + IInkAnalyzer* pInkAnalyzer, + IAnalysisStatus* pAnalysisStatus); + + CMyInkAnalyserEvents(); + + HRESULT Init( HWND hWnd); + +private: +// Pointer to callback Functions + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction; + InkInkDrawingInfo InkInkDrawingInfoFunction; + InkLineBoxInfo InkLineBoxInfoFunction; + InkBulletInfo InkBulletInfoFunction; + AnalyserHasFinished AnalyserHasFinishedFunction; +// TODO MathPanelReply MathPanelReplyFunction; + +public: + void SetCallbacks( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction_In, + InkInkDrawingInfo InkInkDrawingInfoFunction_In, + InkLineBoxInfo InkLineBoxInfoFunction_In, + InkBulletInfo InkBulletInfoFunction_In, + AnalyserHasFinished AnalyserHasFinishedFunction_In +// TODO MathPanelReply MathPanelReplyFunction_In + ); + + HWND m_hWnd; +}; +#endif + +class PaperInkAnalyzer { +private: + // Automation API interface pointers + IInkCollector * g_pIInkCollector; + IInkDisp * g_pIInkDisp; + IInkRenderer* g_pInkRenderer; + +#ifdef ExternAnalyzer +#else + IInkAnalyzer* m_spIInkAnalyzer; +#endif + +// Description of the stroke events +// http://msdn.microsoft.com/en-us/library/aa510904.aspx +///////////////////////////////////////////////////////// +class CMyMathPanelEvents : public MathPanelEvents +{ +public: + + CMyMathPanelEvents() + { + m_hWnd = NULL; + } + + HRESULT Init( + HWND hWnd) + { + m_hWnd = hWnd; + return MathPanelEvents::Init(); + } + + HWND m_hWnd; +}; + +#ifdef StrokeEvents + CMyInkEvents m_InkEvents;// TODO for future use +#endif + CMyInkAnalyserEvents m_InkAnalyserEvents; + + +#ifdef MathInput + IMathInputControl* g_spMIC; // TODO Math Input Control + bool MathInputPanelOpen; + CMyMathPanelEvents m_MathInputEvents; + HWND g_pMainWindowHandle; +#endif + + int PreviousVerticalShiftPos; + float PreviousVerticalShiftPosFloat; + int PreviousHorizontalShiftPos; + float PreviousHorizontalShiftPosFloat; + +#ifdef ExternAnalyzer + HANDLE hWriteChild; + HANDLE hReadChild; + HANDLE ChildOut; + HANDLE ChildIn; + + +structLayoutBoxesCounts LayoutBoxesCounts; +#endif + +void AddStrokeToAnalyzer( IInkStrokeDisp* pIInkStroke); + +public: + PaperInkAnalyzer( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + HWND DrawingHandle); + + ~PaperInkAnalyzer(); + int DeleteAllStrokes(); + + int SendAllStrokesToMathInputPanel(); + + int AnalyzeInk(); + int AddStrokesFromFile(PaperInkConverter* pPaperInkConverter,long StrokeColor); + + int PositioningInkPanel(int Basic_X_Offset, int Basic_Y_Offset, HWND HorizontalScrollHandle, HWND VerticalScrollHandle); + + int CopyToClipboard(); + +#ifdef NoCallback + int FindUpperLeftLinePosition(int* Min_X_Position_Left, int* Min_X_Position_Right, int* Min_Y_Position_TOP, int* Min_Y_PositionBottom); + + int GetInkBullets(); + int GetNextInkBulletsInfo(int BoxIndex, int* Left, int* Top, int* width, int* height ); + + int GetInkLineBoxes(); + int GetNextInkLineBoxInfo(int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ); // Get Next Ink Line Information + + int GetInkDrawingBoxes(); +// int GetNextInkBulletsInfo(int BoxIndex, int* Left, int* Top, int* width, int* height ); + + int GetNextInkInkDrawingHotSpots(int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ); +#endif + +}; + +// Managed Wrapper for Paper Ink Analyzer +PAPERINKANALYZER_API PaperInkAnalyzer* NewPaperInkAnalyzer( + InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + HWND DrawingHandle); +PAPERINKANALYZER_API int DeletePaperInkAnalyzer(PaperInkAnalyzer* pPaperInkAnalyzer);// TODO Check this if we realy need it + +PAPERINKANALYZER_API int SendAllStrokesToMathInputPanel(PaperInkAnalyzer* pPaperInkAnalyzer); + +PAPERINKANALYZER_API int AnalyzeInk(PaperInkAnalyzer* pPaperInkAnalyzer); +PAPERINKANALYZER_API int AddStrokesFromFile(PaperInkAnalyzer* pPaperInkAnalyzer, PaperInkConverter* pPaperInkConverter,long StrokeColor); + +PAPERINKANALYZER_API int DeleteAllStrokes(PaperInkAnalyzer* pPaperInkAnalyzer); +PAPERINKANALYZER_API int PositioningInkPanel(PaperInkAnalyzer* pPaperInkAnalyzer, int Basic_X_Offset, int Basic_Y_Offset, HWND HorizontalScrollHandle, HWND VerticalScrollHandle); + +PAPERINKANALYZER_API int CopyToClipboard(PaperInkAnalyzer* aPaperInkAnalyzer); + +#ifdef NoCallback +PAPERINKANALYZER_API int WrapFindUpperLeftLinePosition(PaperInkAnalyzer* pPaperInkAnalyzer, int* Min_X_Position_Left, int* Min_X_Position_Right, int* Min_Y_Position_TOP, int* Min_Y_PositionBottom); +PAPERINKANALYZER_API int GetInkBullets(PaperInkAnalyzer* pPaperInkAnalyzer); // Read Analysed Bullets and Return the Count +PAPERINKANALYZER_API int GetNextInkBulletsInfo(PaperInkAnalyzer* pPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height ); +PAPERINKANALYZER_API int GetInkLineBoxes(PaperInkAnalyzer* pPaperInkAnalyzer); // Read Analysed Line Boxes and Return the Count +PAPERINKANALYZER_API int GetNextInkLineBoxInfo(PaperInkAnalyzer* pPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ); // Get Next Ink Line Information + +PAPERINKANALYZER_API int GetInkDrawingBoxes(PaperInkAnalyzer* pPaperInkAnalyzer); // Read Analysed Bullets and Return the Count +PAPERINKANALYZER_API int GetNextInkInkDrawingHotSpots(PaperInkAnalyzer* pPaperInkAnalyzer, int BoxIndex, int* Left, int* Top, int* width, int* height, char** pText ); +#endif + +// Managed Wrapper for Paper Ink Converter Class + +PAPERINKANALYZER_API PaperInkConverter* InitPaperInkReader(wchar_t* FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); +PAPERINKANALYZER_API int EOFfound(PaperInkConverter* pPaperInkConverter); + diff --git a/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj new file mode 100644 index 0000000..27da3d1 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj @@ -0,0 +1,173 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {8C9289A5-F0E4-46E1-A110-477E60BBEA92} + Win32Proj + GeneralInkRecognizer + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;GENERALINKANALYZER_EXPORTS;MathInput;DebugDLL;aExternAnalyzer;NoStrokeEvents;%(PreprocessorDefinitions) + $(SolutionDir)\PaperInkConverter + Default + MultiThreadedDebug + + + Windows + true + $(SolutionDir)PaperInkConverter\$(Platform)\Debug\PaperInkConverter.lib + false + false + + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;GENERALINKANALYZER_EXPORTS;MathInput;DebugDLL;ExternAnalyzer;NoStrokeEvents;%(PreprocessorDefinitions) + $(SolutionDir)\PaperInkConverter + MultiThreadedDebug + + + Windows + true + $(SolutionDir)PaperInkConverter\$(Platform)\Debug\PaperInkConverter.lib + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;GENERALINKANALYZER_EXPORTS;MathInput;NoStrokeEvents;%(PreprocessorDefinitions) + $(SolutionDir)\PaperInkConverter + MultiThreaded + + + Windows + true + true + true + $(SolutionDir)PaperInkConverter\$(Platform)\Release\PaperInkConverter.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;GENERALINKANALYZER_EXPORTS;MathInput;ExternAnalyzer;NoStrokeEvents;%(PreprocessorDefinitions) + $(SolutionDir)\PaperInkConverter + MultiThreaded + + + Windows + true + true + true + $(SolutionDir)PaperInkConverter\$(Platform)\Release\PaperInkConverter.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.filters b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.filters new file mode 100644 index 0000000..78621f0 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.user b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/GeneralInkRecognizer.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PaperInkRecognizer/GeneralInkRecognizer/InkEvents.h b/PaperInkRecognizer/GeneralInkRecognizer/InkEvents.h new file mode 100644 index 0000000..7d4fc24 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/InkEvents.h @@ -0,0 +1,1070 @@ +//-------------------------------------------------------------------------- +// This is part of the Microsoft Tablet PC Platform SDK +// Copyright (C) 2002 Microsoft Corporation +// All rights reserved. +// +// This source code is only intended as a supplement to the +// Microsoft Tablet PC Platform SDK Reference and related electronic +// documentation provided with the Software Development Kit. +// See these sources for more detailed information. +// +// Module: +// TpcConpt.h +// +// Description: +// The header file for InkCollectorEvents, which is designed +// to be used by C++ applications as a base class for handling +// Ink Collector events. This base class is meant to be used +// as a template; application-specific event handling should +// be handled by the derived class. For an example of how to use +// this class, refer to CMyInkEvents in EventSink.h. +// +// This file contains both the class definitions and the implementation +// of the methods. +// +//-------------------------------------------------------------------------- + +#ifndef TPCCONPT_H +#define TPCCONPT_H + +///////////////////////////////////////////////////////// +// +// class InkCollectorEvents +// +// The InkCollectorEvents class handles passing Ink Collector +// events from the Ink Collector to the user of this class. +// It sets up the connection between the InkCollector and +// this class in AdviseInkCollector. In the Invoke method, +// it converts the IDispatch event notification into a +// call to a virtual function which the user of this class +// can override to process a particular event. +// +// Two important points to consider when using this class: +// +// 1. You must do more than simply override the event's +// virtual function in order to handle the event. For +// all but default events, you will have to call +// IInkCollector::SetEventInterest to guarantee getting +// an event. Stroke, CursorInRange, andCursorOutOfRange are +// the only event interests that are on by default. +// +// 2. This object marshals itself free threaded so all implemented +// event handlers need to be free threaded as well. Of particular +// importance is using Window's APIs, which may cause a switch to +// another thread; the event handler is not guaranteed +// to be running on the same thread as the window connected +// with the Ink Collector. +// +///////////////////////////////////////////////////////// +class InkCollectorEvents : public _IInkCollectorEvents +{ +public: + + // + // IUnknown Interface + // + HRESULT __stdcall QueryInterface( + REFIID riid, + void **ppvObject) + { + + // Validate the input + if (NULL == ppvObject) + { + return E_POINTER; + } + + // This object only supports IDispatch/_IInkCollectorEvents + if ((riid == IID_IUnknown) + || (riid == IID_IDispatch) + || (riid == DIID__IInkCollectorEvents)) + { + *ppvObject = (IDispatch *) this; + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + + return S_OK; + } + else if (riid == IID_IMarshal) + { + // Assert that the free threaded marshaller has been + // initialized. It is necessary to call Init() before + // invoking this method. + assert(NULL != m_punkFTM); + + // Use free threaded marshalling. + return m_punkFTM->QueryInterface(riid, ppvObject); + } + + return E_NOINTERFACE; + } + + virtual ULONG STDMETHODCALLTYPE AddRef() + { + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + virtual ULONG STDMETHODCALLTYPE Release() + { + + // Note: we do not do Release here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + // + // IDispatch Interface + // + STDMETHOD(GetTypeInfoCount)(UINT* pctinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetTypeInfo)( + UINT itinfo, + LCID lcid, + ITypeInfo** pptinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetIDsOfNames)( + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, + LCID lcid, + DISPID* rgdispid) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + // Invoke translates from IDispatch to an event callout + // that can be overriden by a subclass of this class. + STDMETHOD(Invoke)( + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD /*wFlags*/, + DISPPARAMS* pdispparams, + VARIANT* pvarResult, + EXCEPINFO* /*pexcepinfo*/, + UINT* /*puArgErr*/) + { + switch(dispidMember) + { + case DISPID_ICEStroke: + Stroke( + (IInkCursor*) pdispparams->rgvarg[2].pdispVal, + (IInkStrokeDisp*) pdispparams->rgvarg[1].pdispVal, + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_ICECursorDown: + CursorDown( + (IInkCursor*) pdispparams->rgvarg[1].pdispVal, + (IInkStrokeDisp*) pdispparams->rgvarg[0].pdispVal); + break; + + case DISPID_ICENewPackets: + NewPackets( + (IInkCursor*) pdispparams->rgvarg[3].pdispVal, + (IInkStrokeDisp*) pdispparams->rgvarg[2].pdispVal, + pdispparams->rgvarg[1].lVal, + pdispparams->rgvarg[0].pvarVal); + break; + + case DISPID_IPEDblClick: + DblClick( + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_IPEMouseMove: + MouseMove( + (InkMouseButton) pdispparams->rgvarg[4].lVal, + (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal, + pdispparams->rgvarg[2].lVal, + pdispparams->rgvarg[1].lVal, + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_IPEMouseDown: + MouseDown( + (InkMouseButton) pdispparams->rgvarg[4].lVal, + (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal, + pdispparams->rgvarg[2].lVal, + pdispparams->rgvarg[1].lVal, + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_IPEMouseUp: + MouseUp( + (InkMouseButton) pdispparams->rgvarg[4].lVal, + (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal, + pdispparams->rgvarg[2].lVal, + pdispparams->rgvarg[1].lVal, + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_IPEMouseWheel: + MouseWheel( + (InkMouseButton) pdispparams->rgvarg[5].lVal, + (InkShiftKeyModifierFlags) pdispparams->rgvarg[4].lVal, + pdispparams->rgvarg[3].lVal, + pdispparams->rgvarg[2].lVal, + pdispparams->rgvarg[1].lVal, + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_ICENewInAirPackets: + NewInAirPackets( + (IInkCursor*) pdispparams->rgvarg[2].pdispVal, + pdispparams->rgvarg[1].lVal, + pdispparams->rgvarg[0].pvarVal); + break; + + case DISPID_ICECursorButtonDown: + CursorButtonDown( + (IInkCursor*) pdispparams->rgvarg[1].pdispVal, + (IInkCursorButton*) pdispparams->rgvarg[0].pdispVal); + break; + + case DISPID_ICECursorButtonUp: + CursorButtonUp( + (IInkCursor*) pdispparams->rgvarg[1].pdispVal, + (IInkCursorButton*) pdispparams->rgvarg[0].pdispVal); + break; + + case DISPID_ICECursorInRange: + CursorInRange( + (IInkCursor*) pdispparams->rgvarg[2].pdispVal, + (VARIANT_BOOL) pdispparams->rgvarg[1].iVal, + pdispparams->rgvarg[0]); + break; + + case DISPID_ICECursorOutOfRange: + CursorOutOfRange( + (IInkCursor*) pdispparams->rgvarg[0].pdispVal); + break; + + case DISPID_ICESystemGesture: + SystemGesture( + (IInkCursor*) pdispparams->rgvarg[6].pdispVal, + (InkSystemGesture) pdispparams->rgvarg[5].lVal, + pdispparams->rgvarg[4].lVal, + pdispparams->rgvarg[3].lVal, + pdispparams->rgvarg[2].lVal, + pdispparams->rgvarg[1].bstrVal, + pdispparams->rgvarg[0].lVal); + break; + + case DISPID_ICEGesture: + Gesture( + (IInkCursor*) pdispparams->rgvarg[3].pdispVal, + (IInkStrokes*) pdispparams->rgvarg[2].pdispVal, + pdispparams->rgvarg[1], + (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal); + break; + + case DISPID_ICETabletAdded: + TabletAdded( + (IInkTablet*) pdispparams->rgvarg[0].pdispVal); + break; + + case DISPID_ICETabletRemoved: + TabletRemoved( + pdispparams->rgvarg[0].lVal); + break; + + default: + break; + } + + return S_OK; + } + + // + // Events + // + + virtual void Stroke( + IInkCursor* Cursor, + IInkStrokeDisp* Stroke, + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void CursorDown( + IInkCursor* Cursor, + IInkStrokeDisp* Stroke) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void NewPackets( + IInkCursor* Cursor, + IInkStrokeDisp* Stroke, + long PacketCount, + VARIANT* PacketData) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void DblClick( + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void MouseMove( + InkMouseButton Button, + InkShiftKeyModifierFlags Shift, + long pX, + long pY, + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void MouseDown( + InkMouseButton Button, + InkShiftKeyModifierFlags Shift, + long pX, + long pY, + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void MouseUp( + InkMouseButton Button, + InkShiftKeyModifierFlags Shift, + long pX, + long pY, + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void MouseWheel( + InkMouseButton Button, + InkShiftKeyModifierFlags Shift, + long Delta, + long X, + long Y, + VARIANT_BOOL *Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void NewInAirPackets( + IInkCursor* Cursor, + long lPacketCount, + VARIANT* PacketData) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void CursorButtonDown( + IInkCursor* Cursor, + IInkCursorButton* Button) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void CursorButtonUp( + IInkCursor* Cursor, + IInkCursorButton* Button) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void CursorInRange( + IInkCursor* Cursor, + VARIANT_BOOL NewCursor, + VARIANT ButtonsState) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void CursorOutOfRange( + IInkCursor* Cursor) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void SystemGesture( + IInkCursor* Cursor, + InkSystemGesture Id, + long X, + long Y, + long Modifier, + BSTR Character, + long CursorMode) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void Gesture( + IInkCursor* Cursor, + IInkStrokes* Strokes, + VARIANT Gestures, + VARIANT_BOOL* Cancel) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void TabletAdded( + IInkTablet* Tablet) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + virtual void TabletRemoved( + long TabletId) + { + // This is a place holder designed to be overridden by + // user of this class. + return; + } + + // + // Methods + // + + // Constructor: initialize memory to null. + InkCollectorEvents() + { + m_pIConnectionPoint = NULL; + m_punkFTM = NULL; + } + + // Destructor: free resources + ~InkCollectorEvents() + { + UnadviseInkCollector(); + + if (m_punkFTM != NULL) + { + m_punkFTM->Release(); + } + } + + // Init: set up free threaded marshaller. + // It is necessary to call this method before using + // this class to handle events. + HRESULT Init() + { + return CoCreateFreeThreadedMarshaler(this, &m_punkFTM); + } + + // Set up connection between sink and Ink Collector + HRESULT AdviseInkCollector( + IInkCollector *pIInkCollector) + { + HRESULT hr = S_OK; + + // Check to ensure that the sink is not currently connected + // with another Ink Collector... + if (NULL == m_pIConnectionPoint) + { + // Get the connection point container + IConnectionPointContainer *pIConnectionPointContainer; + hr = pIInkCollector->QueryInterface( + IID_IConnectionPointContainer, + (void **) &pIConnectionPointContainer); + + if (FAILED(hr)) + { + return hr; + } + + // Find the connection point for Ink Collector events + hr = pIConnectionPointContainer->FindConnectionPoint( + __uuidof(_IInkCollectorEvents), &m_pIConnectionPoint); + + if (SUCCEEDED(hr)) + { + // Hook up sink to connection point + hr = m_pIConnectionPoint->Advise(this, &m_dwCookie); + } + + if (FAILED(hr)) + { + // Clean up after an error. + if (m_pIConnectionPoint) + { + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + } + + // We don't need the connection point container any more. + pIConnectionPointContainer->Release(); + } + // If the sink is already connected to an Ink Collector, return a + // failure; only one Ink Collector can be attached at any given time. + else + { + hr = E_FAIL; + } + + return hr; + } + + // Remove the connection of the sink to the Ink Collector + HRESULT UnadviseInkCollector() + { + HRESULT hr = S_OK; + + // If there the ink collector is connected to the sink, + // remove it. Otherwise, do nothing (there is nothing + // to unadvise). + if (m_pIConnectionPoint != NULL) + { + hr = m_pIConnectionPoint->Unadvise(m_dwCookie); + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + + return hr; + } + +private: + + // + // Data Members + // + + // Connection point on InkCollector + IConnectionPoint *m_pIConnectionPoint; + + // Cookie returned from advise + DWORD m_dwCookie; + + // Free threaded marshaler. + IUnknown *m_punkFTM; +}; + +#ifdef ExternAnalyzer +#else +// Eventhandler for the Ink Analyser Events +class InkAnalyserEvents : public _IAnalysisEvents +{ +public: + + // + // IUnknown Interface + // + HRESULT __stdcall QueryInterface( + REFIID riid, + void **ppvObject) + { + + // Validate the input + if (NULL == ppvObject) + { + return E_POINTER; + } + + // This object only supports IDispatch/_IInkCollectorEvents + if ((riid == IID_IUnknown) + || (riid == IID_IDispatch) + || (riid == IID__IAnalysisEvents)) + { + *ppvObject = (IDispatch *) this; + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + + return S_OK; + } + + return E_NOINTERFACE; + } + + virtual ULONG STDMETHODCALLTYPE AddRef() + { + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + virtual ULONG STDMETHODCALLTYPE Release() + { + + // Note: we do not do Release here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + // + // IDispatch Interface + // + STDMETHOD(GetTypeInfoCount)(UINT* pctinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetTypeInfo)( + UINT itinfo, + LCID lcid, + ITypeInfo** pptinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetIDsOfNames)( + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, + LCID lcid, + DISPID* rgdispid) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + + // + // Events + // + + virtual HRESULT STDMETHODCALLTYPE ResultsUpdated( + /* [in] */ IInkAnalyzer *pInkAnalyzer, + /* [in] */ IAnalysisStatus *pAnalysisStatus) { + // This is a place holder designed to be overridden by + // user of this class. + return (S_OK); + }; + + virtual HRESULT STDMETHODCALLTYPE IntermediateResultsUpdated( + /* [in] */ IInkAnalyzer *pInkAnalyzer, + /* [in] */ IAnalysisStatus *pAnalysisStatus) { + // This is a place holder designed to be overridden by + // user of this class. + return (S_OK); + }; + + virtual HRESULT STDMETHODCALLTYPE Activity( void) { + // This is a place holder designed to be overridden by + // user of this class. + return (S_OK); + } + + virtual HRESULT STDMETHODCALLTYPE UpdateStrokesCache( + /* [in] */ ULONG ulStrokeIdsCount, + /* [size_is][in] */ LONG *plStrokeIds) { + // This is a place holder designed to be overridden by + // user of this class. + return (S_OK); + } + + virtual HRESULT STDMETHODCALLTYPE ReadyToReconcile( void) { + // This is a place holder designed to be overridden by + // user of this class. + return (S_OK); + } + + // + // Methods + // + + // Constructor: initialize memory to null. + InkAnalyserEvents() + { + m_pIConnectionPoint = NULL; + } + + // Destructor: free resources + ~InkAnalyserEvents() + { + UnadviseInkAnalyzer(); + } + + + // Set up connection between sink and Ink Collector + HRESULT AdviseInkAnalyser( + IInkAnalyzer *pIInkAnalyser) + { + HRESULT hr = S_OK; + + // Check to ensure that the sink is not currently connected + // with another Ink Collector... + if (NULL == m_pIConnectionPoint) + { + // Get the connection point container + IConnectionPointContainer *pIConnectionPointContainer; + hr = pIInkAnalyser->QueryInterface( + IID_IConnectionPointContainer, + (void **) &pIConnectionPointContainer); + + if (FAILED(hr)) + { + return hr; + } + + // Find the connection point for Ink Analyser events + hr = pIConnectionPointContainer->FindConnectionPoint( + __uuidof(_IAnalysisEvents), &m_pIConnectionPoint); + + if (SUCCEEDED(hr)) + { + // Hook up sink to connection point + hr = m_pIConnectionPoint->Advise(this, &m_dwCookie); + } + + if (FAILED(hr)) + { + // Clean up after an error. + if (m_pIConnectionPoint) + { + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + } + + // We don't need the connection point container any more. + pIConnectionPointContainer->Release(); + } + // If the sink is already connected to an Ink Collector, return a + // failure; only one Ink Collector can be attached at any given time. + else + { + hr = E_FAIL; + } + + return hr; + } + + // Remove the connection of the sink to the Ink Analyzer + HRESULT UnadviseInkAnalyzer() + { + HRESULT hr = S_OK; + + // If there the ink collector is connected to the sink, + // remove it. Otherwise, do nothing (there is nothing + // to unadvise). + if (m_pIConnectionPoint != NULL) + { + hr = m_pIConnectionPoint->Unadvise(m_dwCookie); + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + + return hr; + } + +private: + + // + // Data Members + // + + // Connection point on InkCollector + IConnectionPoint *m_pIConnectionPoint; + + // Cookie returned from advise + DWORD m_dwCookie; + +}; +#endif + + +class MathPanelEvents : public _IMathInputControlEvents +{ +public: + + // + // IUnknown Interface + // + HRESULT __stdcall QueryInterface( + REFIID riid, + void **ppvObject) + { + + // Validate the input + if (NULL == ppvObject) + { + return E_POINTER; + } + + // This object only supports IDispatch/_IInkCollectorEvents + if ((riid == IID_IUnknown) + || (riid == IID_IDispatch) + || (riid == DIID__IMathInputControlEvents)) + { + *ppvObject = (IDispatch *) this; + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + + return S_OK; + } + else if (riid == IID_IMarshal) + { +DebugBreak();// TODO Check this path + // Assert that the free threaded marshaller has been + // initialized. It is necessary to call Init() before + // invoking this method. + assert(NULL != m_punkFTM);// TODO Remove this variable + + // Use free threaded marshalling. + return m_punkFTM->QueryInterface(riid, ppvObject); + } + + return E_NOINTERFACE; + } + + virtual ULONG STDMETHODCALLTYPE AddRef() + { + + // Note: we do not AddRef here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + virtual ULONG STDMETHODCALLTYPE Release() + { + + // Note: we do not do Release here because the lifetime + // of this object does not depend on reference counting + // but on the duration of the connection set up by + // the user of this class. + return 1; + } + + // + // IDispatch Interface + // + STDMETHOD(GetTypeInfoCount)(UINT* pctinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetTypeInfo)( + UINT itinfo, + LCID lcid, + ITypeInfo** pptinfo) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + STDMETHOD(GetIDsOfNames)( + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, + LCID lcid, + DISPID* rgdispid) + { + // This method is not needed for processing events. + return E_NOTIMPL; + } + + // Invoke translates from IDispatch to an event callout + // that can be overriden by a subclass of this class. + STDMETHOD(Invoke)( + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD /*wFlags*/, + DISPPARAMS* pdispparams, + VARIANT* pvarResult, + EXCEPINFO* /*pexcepinfo*/, + UINT* /*puArgErr*/) + { + switch(dispidMember) + { + default: + break; + } + + return S_OK; + } + + + // Constructor: initialize memory to null. + MathPanelEvents() + { + m_pIConnectionPoint = NULL; + m_punkFTM = NULL; + } + + // Destructor: free resources + ~MathPanelEvents() + { + UnadviseMathInputPanel(); + + if (m_punkFTM != NULL) + { + m_punkFTM->Release(); + } + } + + // Init: set up free threaded marshaller. + // It is necessary to call this method before using + // this class to handle events. + HRESULT Init() + { + return CoCreateFreeThreadedMarshaler(this, &m_punkFTM); + } + + // Set up connection between sink and Math Panel + HRESULT AdviseMathInputPanel( + IMathInputControl *pIMathInputControl) + { + HRESULT hr = S_OK; + + // Check to ensure that the sink is not currently connected + // with another Ink Collector... + if (NULL == m_pIConnectionPoint) + { + IUnknown *pUnknown = NULL;// TODO + + hr = this->QueryInterface( + IID_IUnknown, + (void **)&pUnknown); + + if( FAILED(hr) ) + { + return hr; + } + + // Get the connection point container + IConnectionPointContainer *pIConnectionPointContainer; + hr = pIMathInputControl->QueryInterface( + IID_IConnectionPointContainer, + (void **) &pIConnectionPointContainer); + + if (FAILED(hr)) + { + return hr; + } + + // Find the connection point for Ink Analyser events + hr = pIConnectionPointContainer->FindConnectionPoint( + __uuidof(_IMathInputControlEvents), &m_pIConnectionPoint); + + if (SUCCEEDED(hr)) + { + // Hook up sink to connection point + hr = m_pIConnectionPoint->Advise(pUnknown, &m_dwCookie); + } + + if (FAILED(hr)) + { + // Clean up after an error. + if (m_pIConnectionPoint) + { + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + } + + // We don't need the connection point container any more. + pIConnectionPointContainer->Release(); + } + // If the sink is already connected to an Ink Collector, return a + // failure; only one Ink Collector can be attached at any given time. + else + { + hr = E_FAIL; + } + + return hr; + } + + HRESULT UnadviseMathInputPanel() + { + HRESULT hr = S_OK; + + // If there the ink collector is connected to the sink, + // remove it. Otherwise, do nothing (there is nothing + // to unadvise). + if (m_pIConnectionPoint != NULL) + { + hr = m_pIConnectionPoint->Unadvise(m_dwCookie); + m_pIConnectionPoint->Release(); + m_pIConnectionPoint = NULL; + } + + return hr; + } + +private: + + // + // Data Members + // + + // Connection point on InkCollector + IConnectionPoint *m_pIConnectionPoint; + + // Cookie returned from advise + DWORD m_dwCookie; + + // Free threaded marshaler. + IUnknown *m_punkFTM; +}; + +#endif // TPCCONPT_H diff --git a/PaperInkRecognizer/GeneralInkRecognizer/ReadMe.txt b/PaperInkRecognizer/GeneralInkRecognizer/ReadMe.txt new file mode 100644 index 0000000..f606b61 --- /dev/null +++ b/PaperInkRecognizer/GeneralInkRecognizer/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : GeneralInkRecognizer Project Overview +======================================================================== + +AppWizard has created this GeneralInkRecognizer DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your GeneralInkRecognizer application. + + +GeneralInkRecognizer.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +GeneralInkRecognizer.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +GeneralInkRecognizer.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named GeneralInkRecognizer.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/PaperInkRecognizer/InkAnalyser32/AnalyzerCommunication.h b/PaperInkRecognizer/InkAnalyser32/AnalyzerCommunication.h new file mode 100644 index 0000000..b3518d9 --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/AnalyzerCommunication.h @@ -0,0 +1,66 @@ +#pragma once + +// includes for the 64 Bit / 32 Bit Analyzer communication +typedef enum InkAnalyzerResult { + AnalyzingReady = 0, + AnalyzerResultAvailable, + LineBoxes, + BulletBoxes, + InkDrawingBoxes, + InkAnalyzeFinished, + InkAnalyzerUnadvise, + FinischInkAnalyzerListener +}; + +typedef struct sCountInfo{ + ULONG LineBoxesCount; + ULONG BulletBoxesCount; + ULONG DrawinfBoxesCount; +}; + +typedef struct structLayoutBoxesCounts { + long command; + sCountInfo CountInfo; +}; + +enum AnalyzerCommand { + AnalyzeStrokes = 1, + AddAnalyzerStroke, + SearchUpperLeftLinePosition, + GetLineBoxInfo, + GetBulletPosition, + GetDrawingHotspots, + ClearAllAnalyzerStrokes, + AdviseInkAnylyzer, + UnanadviseInkAnylyzer, + FinishInkAnylyzer +}; + +struct sPointsInfo{ + long X_MinValue_Left; + long X_MinValue_Right; + long Y_MinValue_Top; + long Y_MinValue_Bottom; +}; +struct sLineBoxInfo{ + int Left; + int Top; + int width; + int height; + int RecognizedStringSize; +}; + +struct sBulletBoxInfo{ + int Left; + int Top; + int width; + int height; +}; + +struct sDrawingBoxInfo{ + int Left; + int Top; + int width; + int height; + int RecognizedStringSize; + }; diff --git a/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.cpp b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.cpp new file mode 100644 index 0000000..034b93a --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.cpp @@ -0,0 +1,486 @@ +/********************************************************************************** + * copyright : (C) 2012 by Herbert Ellebruch + * email : herbert@useful-tools.de + + ********************************************************************************** + * This file is part of PaperInkRecognizer. * + * * + * PaperInkRecognizer is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * Foobar is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with PaperInkRecognizer. If not, see . * + * * + *********************************************************************************/ +#include +//#include + +#include + +// Headers for Tablet PC Automation interfaces +// Headers Included in Tablet PC SDK 1.7 +#include +#include +#include + +// Headers for the Tablet PC Ink Analysis interfaces +#include +#include +#include +#include + +#include "AnalyzerCommunication.h" + +typedef struct AnalyserStrokeInfo { + long id; + ULONG packetDataCount; + ULONG guidCount; +} ; + +typedef struct structUpperPositionPoints { + long command; + sPointsInfo PointsInfo; +}; + +typedef struct structLineBoxesInfo { + long Command; + sLineBoxInfo BoxInfo; +}; + +typedef struct structBulletBoxesInfo { + long Command; + sBulletBoxInfo BoxInfo; +}; + +typedef struct structDrawingBoxHotspots { + long Command; + sDrawingBoxInfo BoxInfo; +}; + +#define BUF_SIZE 256 + IInkAnalyzer* m_spIInkAnalyzer; + BYTE* pLineString = NULL; + static char m_PipeMem[10000];// todo Not static, create with alloc + +int _tmain(int argc, _TCHAR* argv[]) +{ + char* m_Pipe = &m_PipeMem[0];// todo alloc Memory + int receivedCommand; + DWORD BytesRed; + // Create an ink analyzer object. + + if (S_OK == ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)) + { + int x = 3;// todo Insert Error Handling + } + + HANDLE hParentStdIn = GetStdHandle(STD_INPUT_HANDLE); + HANDLE hParentStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + + HRESULT hr = CoCreateInstance(CLSID_InkAnalyzer, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkAnalyzer, + (void **) &m_spIInkAnalyzer); + + if (FAILED(hr)) + int test = 1;//return -1; // todo Insert Error Handling + +// DebugBreak(); + + while (1) { + ReadFile(hParentStdIn,&receivedCommand,sizeof(int),&BytesRed,NULL); + + if (BytesRed < sizeof(int)) break; // End of file received + switch ( (AnalyzerCommand)receivedCommand) { + case AdviseInkAnylyzer: + { + } + break; + case UnanadviseInkAnylyzer: + { + } + break; + case FinishInkAnylyzer: + { + int Command = FinischInkAnalyzerListener; + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&Command,sizeof(Command),&CountBytesWritten,NULL); + } + break; + case AddAnalyzerStroke: + { + ReadFile(hParentStdIn,m_Pipe,sizeof(AnalyserStrokeInfo) ,&BytesRed,NULL); // Now Read the count Values + if (BytesRed < sizeof(AnalyserStrokeInfo)) break; // End of file received + ReadFile(hParentStdIn,m_Pipe+sizeof(AnalyserStrokeInfo),((AnalyserStrokeInfo*)m_Pipe)->guidCount*sizeof(GUID)+ ((AnalyserStrokeInfo*)m_Pipe)->packetDataCount*sizeof(LONG),&BytesRed,NULL); // Now Read the count Values +if (BytesRed > (sizeof(m_PipeMem) - sizeof(AnalyserStrokeInfo))) DebugBreak();// todo realloc more Memory + if (BytesRed < ((AnalyserStrokeInfo*)m_Pipe)->guidCount*sizeof(GUID)+ ((AnalyserStrokeInfo*)m_Pipe)->packetDataCount*sizeof(LONG)) break; // End of file received + + IContextNode* spNode = NULL; + + hr = m_spIInkAnalyzer->AddStroke( + ((AnalyserStrokeInfo*)m_Pipe)->id, // id, + ((AnalyserStrokeInfo*)m_Pipe)->packetDataCount, // packetDataCount, + (LONG*)(m_Pipe+(sizeof(AnalyserStrokeInfo) + ((AnalyserStrokeInfo*)m_Pipe)->guidCount*sizeof(GUID))), // plPacketData, + ((AnalyserStrokeInfo*)m_Pipe)->guidCount, // guidCount, + (GUID*)(m_Pipe+sizeof(AnalyserStrokeInfo)), // pPacketDescGuids, + &spNode); + } + break; + + case AnalyzeStrokes: + { + IAnalysisStatus* status; + hr = m_spIInkAnalyzer->Analyze(&status); + status->Release(); + if (FAILED(hr)) + int test = 1;//return -1; // todo Insert Error Handling + DWORD CountBytesWritten; + + structLayoutBoxesCounts LayoutBoxesCounts; + + IContextNodes *pLineContextNodesfound; // received Line Nodes + HRESULT hr = m_spIInkAnalyzer->FindNodesOfType(&GUID_CNT_LINE, &pLineContextNodesfound); + LayoutBoxesCounts.command = AnalyzingReady; + ULONG LineNodeCount; + hr = pLineContextNodesfound->GetCount(&LineNodeCount);// Todo Error Message ??? + LayoutBoxesCounts.CountInfo.LineBoxesCount = LineNodeCount; + // Now Send the Lines + + IContextNodes *pBulletContextNodesfound; // received Bullet Nodes + hr = m_spIInkAnalyzer->FindNodesOfType(&GUID_CNT_INKBULLET, &pBulletContextNodesfound); + ULONG NumberOfBulletNodes; + hr = pBulletContextNodesfound->GetCount(&NumberOfBulletNodes);// Todo Error Message ??? + LayoutBoxesCounts.CountInfo.BulletBoxesCount = NumberOfBulletNodes; + // Now Send the Bullets + + + IContextNodes *pDrawingContextNodesfound; // received Drawing Nodes + hr = m_spIInkAnalyzer->FindNodesOfType(&GUID_CNT_INKDRAWING, &pDrawingContextNodesfound); + ULONG NumberOfDrawingNodes; + hr = pDrawingContextNodesfound->GetCount(&NumberOfDrawingNodes);// Todo Error Message ??? + LayoutBoxesCounts.CountInfo.DrawinfBoxesCount = NumberOfDrawingNodes; + // Now Send the Ink Drawings + + // Now Send the Left Ink Corner + int Command = AnalyzerResultAvailable; + WriteFile(hParentStdOut,&Command,sizeof(Command),&CountBytesWritten,NULL); + // Now Send the Lines + long temp_X_MinValue_Left = LONG_MAX; + long temp_X_MinValue_Right = LONG_MAX; + long temp_Y_MinValue_Top = LONG_MAX; + long temp_Y_MinValue_Bottom = LONG_MAX; + structUpperPositionPoints UpperPositionPoints; + if (LayoutBoxesCounts.CountInfo.LineBoxesCount != 0) { + for (int BoxIndex = 0;BoxIndex < LayoutBoxesCounts.CountInfo.LineBoxesCount;BoxIndex++) { + IContextNode* pLineNode = NULL; + HRESULT hr = pLineContextNodesfound->GetContextNode(BoxIndex,&pLineNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation; + hr = pLineNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + + if ( bounds.left < temp_X_MinValue_Left) { + temp_X_MinValue_Left = bounds.left; + temp_X_MinValue_Right = bounds.right; + } + if ( bounds.top < temp_Y_MinValue_Top) { + temp_Y_MinValue_Top = bounds.top; + temp_Y_MinValue_Bottom = bounds.bottom; + } + + + structLineBoxesInfo LineBoxesInfo; + LineBoxesInfo.Command = LineBoxes; + LineBoxesInfo.BoxInfo.Left = bounds.left; + LineBoxesInfo.BoxInfo.Top = bounds.top; + LineBoxesInfo.BoxInfo.width = bounds.right - bounds.left; + LineBoxesInfo.BoxInfo.height = bounds.bottom - bounds.top; +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + spLocation->Release(); + ULONG NumberOfCharacterInLine; + hr = pLineNode->GetPropertyData(&GUID_CNP_RECOGNIZEDSTRING,&NumberOfCharacterInLine,&pLineString); +// *pText = (char*) pLineString; + LineBoxesInfo.BoxInfo.RecognizedStringSize = NumberOfCharacterInLine; + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&LineBoxesInfo,sizeof(LineBoxesInfo),&CountBytesWritten,NULL); + WriteFile(hParentStdOut,pLineString,NumberOfCharacterInLine+1, &CountBytesWritten,NULL); + ::CoTaskMemFree(pLineString); // free memory allocated by the GetPropertyData method + pLineNode->Release(); + } + UpperPositionPoints.PointsInfo.X_MinValue_Left = temp_X_MinValue_Left; + UpperPositionPoints.PointsInfo.X_MinValue_Right = temp_X_MinValue_Right; + UpperPositionPoints.PointsInfo.Y_MinValue_Top = temp_Y_MinValue_Top; + UpperPositionPoints.PointsInfo.Y_MinValue_Bottom = temp_Y_MinValue_Bottom; + } else { + UpperPositionPoints.PointsInfo.X_MinValue_Left = 0; + UpperPositionPoints.PointsInfo.X_MinValue_Right = 1; + UpperPositionPoints.PointsInfo.Y_MinValue_Top = 0; + UpperPositionPoints.PointsInfo.Y_MinValue_Bottom = 1; + } + pLineContextNodesfound->Release(); // release Line Nodes + pBulletContextNodesfound->Release(); // release Bullet Nodes + pDrawingContextNodesfound->Release(); // release Drawing Nodes + for (int BoxIndex = 0;BoxIndex < LayoutBoxesCounts.CountInfo.BulletBoxesCount;BoxIndex++) { + IContextNode* pBulletNode = NULL; + HRESULT hr = pBulletContextNodesfound->GetContextNode(BoxIndex,&pBulletNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation; + hr = pBulletNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + spLocation->Release(); + structBulletBoxesInfo BulletBoxesInfo; + BulletBoxesInfo.Command = BulletBoxes; + BulletBoxesInfo.BoxInfo.Left = bounds.left; + BulletBoxesInfo.BoxInfo.Top = bounds.top; + BulletBoxesInfo.BoxInfo.width = bounds.right - bounds.left; + BulletBoxesInfo.BoxInfo.height = bounds.bottom - bounds.top; +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + pBulletNode->Release(); + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&BulletBoxesInfo,sizeof(BulletBoxesInfo),&CountBytesWritten,NULL); + } + + + // Now Send the Ink Drawings + for (int BoxIndex=0; BoxIndex < LayoutBoxesCounts.CountInfo.DrawinfBoxesCount; BoxIndex++) { + IContextNode* pDrawingNode = NULL; + HRESULT hr = pDrawingContextNodesfound->GetContextNode(BoxIndex,&pDrawingNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation; + hr = pDrawingNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + structDrawingBoxHotspots DrawingBoxHotspots; + DrawingBoxHotspots.Command = InkDrawingBoxes; + DrawingBoxHotspots.BoxInfo.Left = bounds.left; + DrawingBoxHotspots.BoxInfo.Top = bounds.top; + DrawingBoxHotspots.BoxInfo.width = bounds.right - bounds.left; + DrawingBoxHotspots.BoxInfo.height = bounds.bottom - bounds.top; + spLocation->Release(); +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + ULONG NumberOfCharacterInLine; + hr = pDrawingNode->GetPropertyData(&GUID_CNP_SHAPENAME,&NumberOfCharacterInLine,&pLineString); +// *pText = (char*) pLineString; + DrawingBoxHotspots.BoxInfo.RecognizedStringSize = NumberOfCharacterInLine; + pDrawingNode->Release(); + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&DrawingBoxHotspots,sizeof(DrawingBoxHotspots),&CountBytesWritten,NULL); + WriteFile(hParentStdOut,pLineString,NumberOfCharacterInLine+1, &CountBytesWritten,NULL); + ::CoTaskMemFree(pLineString); // free memory allocated by the GetPropertyData method + } + + + // Now Send Analyse finished + UpperPositionPoints.command = InkAnalyzeFinished; + WriteFile(hParentStdOut,&UpperPositionPoints,sizeof(UpperPositionPoints),&CountBytesWritten,NULL); + } + break; + +#ifdef NoMoreUsed + case SearchUpperLeftLinePosition: + { + IContextNodes *pContextNodesfound = NULL; + + HRESULT hr = m_spIInkAnalyzer->FindNodesOfType(&GUID_CNT_LINE, &pContextNodesfound); + ULONG LineNodeCount; + structUpperPositionPoints UpperPositionPoints; + long temp_X_MinValue_Left = LONG_MAX; + long temp_X_MinValue_Right = LONG_MAX; + long temp_Y_MinValue_Top = LONG_MAX; + long temp_Y_MinValue_Bottom = LONG_MAX; + + hr = pContextNodesfound->GetCount(&LineNodeCount); + + if (LineNodeCount != 0) { + for (int i = 0;iGetContextNode(i,&pLineNode); + + // Use the location's bounds + RECT bounds; + // Use the location's bounds + IAnalysisRegion* spLocation // release??? + hr = pLineNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + if ( bounds.left < temp_X_MinValue_Left) { + temp_X_MinValue_Left = bounds.left; + temp_X_MinValue_Right = bounds.right; + } + if ( bounds.top < temp_Y_MinValue_Top) { + temp_Y_MinValue_Top = bounds.top; + temp_Y_MinValue_Bottom = bounds.bottom; + } + } + UpperPositionPoints.PointsInfo.X_MinValue_Left = temp_X_MinValue_Left; + UpperPositionPoints.PointsInfo.X_MinValue_Right = temp_X_MinValue_Right; + UpperPositionPoints.PointsInfo.Y_MinValue_Top = temp_Y_MinValue_Top; + UpperPositionPoints.PointsInfo.Y_MinValue_Bottom = temp_Y_MinValue_Bottom; + } else { + UpperPositionPoints.PointsInfo.X_MinValue_Left = 0; + UpperPositionPoints.PointsInfo.X_MinValue_Right = 1; + UpperPositionPoints.PointsInfo.Y_MinValue_Top = 0; + UpperPositionPoints.PointsInfo.Y_MinValue_Bottom = 1; + } + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&UpperPositionPoints,sizeof(UpperPositionPoints),&CountBytesWritten,NULL); + } + break; +#endif + +#ifdef NoMoreUsed + case GetLineBoxInfo: + { + int BoxIndex; + DWORD BytesRed; + ReadFile(hParentStdIn,&BoxIndex,sizeof(int),&BytesRed,NULL); + if (BytesRed < sizeof(int)) break; // End of file received + IContextNode* pLineNode = NULL;// release??? + HRESULT hr = pLineContextNodesfound->GetContextNode(BoxIndex,&pLineNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation;// release??? + hr = pLineNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + structLineBoxesInfo LineBoxesInfo; + LineBoxesInfo.Command = LineBoxes; + LineBoxesInfo.BoxInfo.Left = bounds.left; + LineBoxesInfo.BoxInfo.Top = bounds.top; + LineBoxesInfo.BoxInfo.width = bounds.right - bounds.left; + LineBoxesInfo.BoxInfo.height = bounds.bottom - bounds.top; +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + //pLineNode->GetId( + ULONG NumberOfCharacterInLine; + hr = pLineNode->GetPropertyData(&GUID_CNP_RECOGNIZEDSTRING,&NumberOfCharacterInLine,&pLineString); +// *pText = (char*) pLineString; + LineBoxesInfo.BoxInfo.RecognizedStringSize = NumberOfCharacterInLine; + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&LineBoxesInfo,sizeof(LineBoxesInfo),&CountBytesWritten,NULL); + WriteFile(hParentStdOut,pLineString,NumberOfCharacterInLine+1, &CountBytesWritten,NULL); + ::CoTaskMemFree(pLineString); // free memory allocated by the GetPropertyData method + } + break; +#endif + +#ifdef NoMoreUsed + case GetBulletPosition: + { + int BoxIndex; + DWORD BytesRed; + ReadFile(hParentStdIn,&BoxIndex,sizeof(int),&BytesRed,NULL); + if (BytesRed < sizeof(int)) break; // End of file received + IContextNode* pBulletNode = NULL;// release??? + HRESULT hr = pBulletContextNodesfound->GetContextNode(BoxIndex,&pBulletNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation;// release??? + hr = pBulletNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + structBulletBoxesInfo BulletBoxesInfo; + BulletBoxesInfo.Command = BulletBoxes; + BulletBoxesInfo.BoxInfo.Left = bounds.left; + BulletBoxesInfo.BoxInfo.Top = bounds.top; + BulletBoxesInfo.BoxInfo.width = bounds.right - bounds.left; + BulletBoxesInfo.BoxInfo.height = bounds.bottom - bounds.top; +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&BulletBoxesInfo,sizeof(BulletBoxesInfo),&CountBytesWritten,NULL); + } + break; +#endif + +#ifdef NoMoreUsed + case GetDrawingHotspots: + { + int BoxIndex; + DWORD BytesRed; + ReadFile(hParentStdIn,&BoxIndex,sizeof(int),&BytesRed,NULL); + if (BytesRed < sizeof(int)) break; // End of file received + IContextNode* pDrawingNode = NULL;// release??? + HRESULT hr = pDrawingContextNodesfound->GetContextNode(BoxIndex,&pDrawingNode); + RECT bounds; + // Get the location's bounds + IAnalysisRegion* spLocation;// release??? + hr = pDrawingNode->GetLocation(&spLocation); + if( SUCCEEDED(hr) ) + { + hr = spLocation->GetBounds(&bounds); + } + structDrawingBoxHotspots DrawingBoxHotspots; + DrawingBoxHotspots.Command = InkDrawingBoxes; + DrawingBoxHotspots.BoxInfo.Left = bounds.left; + DrawingBoxHotspots.BoxInfo.Top = bounds.top; + DrawingBoxHotspots.BoxInfo.width = bounds.right - bounds.left; + DrawingBoxHotspots.BoxInfo.height = bounds.bottom - bounds.top; +// if (pLineString != NULL) { +// ::CoTaskMemFree(pLineString); // free previous memory allocated by the GetPropertyData method +// } + //pLineNode->GetId( + ULONG NumberOfCharacterInLine; + hr = pDrawingNode->GetPropertyData(&GUID_CNP_SHAPENAME,&NumberOfCharacterInLine,&pLineString); +// *pText = (char*) pLineString; + DrawingBoxHotspots.BoxInfo.RecognizedStringSize = NumberOfCharacterInLine; + DWORD CountBytesWritten; + WriteFile(hParentStdOut,&DrawingBoxHotspots,sizeof(DrawingBoxHotspots.BoxInfo),&CountBytesWritten,NULL); + WriteFile(hParentStdOut,pLineString,NumberOfCharacterInLine+1, &CountBytesWritten,NULL); + ::CoTaskMemFree(pLineString); // free memory allocated by the GetPropertyData method + } + break; +#endif + + + case ClearAllAnalyzerStrokes: + { + m_spIInkAnalyzer->Release(); + hr = CoCreateInstance(CLSID_InkAnalyzer,//CLSID_InkRecognizerContext, + NULL, CLSCTX_INPROC_SERVER, + IID_IInkAnalyzer,//IID_IInkRecognizerContext, + (void **) &m_spIInkAnalyzer); + if (FAILED(hr)) + int kkkk = 0;// return -1; // todo Insert Error Handling + } + break; + + }; + } + m_spIInkAnalyzer->Release(); + + return 0; +} + diff --git a/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcproj.virtual-7-64.entwickler.user b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcproj.virtual-7-64.entwickler.user new file mode 100644 index 0000000..5bdab0e --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcproj.virtual-7-64.entwickler.user @@ -0,0 +1,65 @@ + + + + + + + + + + + diff --git a/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj new file mode 100644 index 0000000..e12abcc --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {39302845-AC68-4395-80C0-83B063854810} + InkAnalyser32 + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(ProjectDir)$(Configuration)\ + $(Configuration)\ + true + $(ProjectDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + true + Console + MachineX86 + + + + + MaxSpeed + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + true + + + Level3 + ProgramDatabase + + + true + Console + true + true + MachineX86 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.filters b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.filters new file mode 100644 index 0000000..f8db766 --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.user b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/InkAnalyser32.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PaperInkRecognizer/InkAnalyser32/ReadMe.txt b/PaperInkRecognizer/InkAnalyser32/ReadMe.txt new file mode 100644 index 0000000..f8c4cc6 --- /dev/null +++ b/PaperInkRecognizer/InkAnalyser32/ReadMe.txt @@ -0,0 +1,33 @@ +======================================================================== + CONSOLE APPLICATION : InkAnalyser32 Project Overview +======================================================================== + +AppWizard has created this InkAnalyser32 application for you. + +This file contains a summary of what you will find in each of the files that +make up your InkAnalyser32 application. + + +InkAnalyser32.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +InkAnalyser32.cpp + This is the main application source file. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named InkAnalyser32.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.cpp b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.cpp new file mode 100644 index 0000000..9ddc5b2 --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.cpp @@ -0,0 +1,439 @@ +/********************************************************************************** + * Copyright : (C) 2012 by Herbert Ellebruch + * Email : herbert@useful-tools.de + + ********************************************************************************** + * * + * PaperInkConverter is free software: you can redistribute it and/or modify * + * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * PaperInkConverter is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE * + * along with PaperInkConverter. If not, see . * + * * + *********************************************************************************/ + /* ******************************************************************************* + Modifications: + 17.Sep 2012 Ellebruch Herbert + Modified Start of Stroke Data + */ +#include +#include +#include + +#include "PaperInkConverter.h" + +PaperInkConverter::PaperInkConverter(wchar_t* Filename, int StrokeThreshold_In, int AllThreshold_In, int SlidingThreshold_In){ + f = _wfopen(Filename,L"rb"); + if (f == NULL) { + SensitivityStrokeIndexList = NULL; + PenPosition_X = NULL; + PenPosition_Y = NULL; + PenPressure = NULL; + PenTilt_X = NULL; + PenTilt_Y = NULL; + + Number_of_Points_in_Substroke = -1; + FileClose = true; + } else { + FileClose = false; + + + maxLayerPressure = 0; + maxSlidingPressure = 0; + + AllThreshold = AllThreshold_In * 164; // Threshold in % * 16384 / 100 (2**14); + StrokeThreshold = StrokeThreshold_In * 164; // Threshold in % * 16384 / 100 (2**14) + + char DummyMem[0x7f8]; // Dummy Buffer to receive unused Dummy information + size_t FileSize = fread((void*)&DummyMem[0],1,sizeof(DummyMem),f); + if (FileSize != sizeof(DummyMem)) { + fclose(f); + Number_of_Points_in_Substroke = -1; + FileClose = true; + } else { + SensitivityStrokeIndexList = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPosition_X = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPosition_Y = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenPressure = (short*)malloc(MaxStoreBuffer*sizeof(short)); + PenTilt_X = (unsigned char*)malloc(MaxStoreBuffer); + PenTilt_Y = (unsigned char*)malloc(MaxStoreBuffer); + *SensitivityStrokeIndexList = 0; // Preset this 2 Values Only Relevant, if there ist + *(SensitivityStrokeIndexList+1) = 0; // no Stroke in the file + + int Status = ReadNextCompleteStroke(); + if (Status == 2) { + // End of File found + freeAllMemory(); + // Already done in ReadNextCompleteStroke + // fclose(f); + // Number_of_Points_in_Substroke = -1; + // FileClose = true; + } + } + } +} + + int PaperInkConverter::ReadGraphicBlock() { + do { + size_t BytesRed = fread((void*)&GraphicBlockMem[0],1,2,f); // Read Block Descriptor and Size + if (BytesRed >= 2) { + Descriptor = GraphicBlockMem[0]; + BlockSize = GraphicBlockMem[1] - 2; + + size_t BlockBytesRed = fread((void*)&GraphicBlockMem[0],1,BlockSize,f); // Read the complete Block + if (BlockBytesRed != BlockSize) { + Number_of_Points_in_Substroke = -1; + FileClose = true; + fclose(f); + // TODO Error Message + return 2; // End of file Found + } + } else { + Number_of_Points_in_Substroke = -1; + FileClose = true; + fclose(f); + return 2; // End of file Found + } + BlockSize = BlockSize; // Subtract Descriptor and Blocksize + } while (BlockSize == 0); // ignore empty Blocks + return 0; // Block is available + } + + /// Search for Stroke Start + // Descriptor 241 Marks Start Stroke Stroke End and New Layer + // 241 03 01 Start of Stroke + // 241 03 00 End of Stroke + // 241 03 128 New Layer + int PaperInkConverter::findStrokeStart() { + int BlockAvailable = 2; // Set block Availble to End of File + int BlockStatus = 0; // Set Blockstatus to Block found + while (1) { + BlockAvailable = ReadGraphicBlock(); + if (BlockAvailable == 0) { + // 241 03 01 Start of Stroke + // 241 03 00 End of Stroke + // 241 03 128 New Layer + if (Descriptor == 241) { // Stroke Delimiter found + int LayerDescriptor = GraphicBlockMem[0]; + if (LayerDescriptor == 01) { // Stroke Start Found + break; + } else if (LayerDescriptor == 00) { // Layer end found + BlockStatus = 1; // Set BlockStatus to Layer end + break; + } else if (LayerDescriptor == 128) { // Layer Changed + BlockStatus = 1; // Set BlockStatus to Layer end + Layer++; + } + } + } else { + BlockStatus = 2; // Set BlockStatus to End of File + break; + } + } + return BlockStatus; + } + +bool PaperInkConverter::RecalcalateStrokesWithThreshold() { + +/* Testpoints +PenPressure[0] = 0; +PenPressure[1] = 0; +PenPressure[2] = 10000; +PenPressure[3] = 10000; +PenPressure[4] = 0; +PenPressure[5] = 0; +PenPressure[6] = 10000; +PenPressure[7] = 10000; +Number_of_Points = 8; +*/ + short* pactualPressure = PenPressure; + short* pactualStrokeIndex = SensitivityStrokeIndexList; + SubStrokeIndex = 0; + int actualThresholdStrokeIndex = 0; + if ((AllThreshold == 0) && (StrokeThreshold == 0)) { // no Threshold set + numberOfSubStrokes = 1; + Number_of_Points_in_Substroke = Number_of_Points; + *SensitivityStrokeIndexList = 0; + } else { + int actualRelativeThreshold = (maxStrokePressure * StrokeThreshold) >> 14; + if (LayerThreshold < actualRelativeThreshold) { + if (AllThreshold > 0 ) { + actualRelativeThreshold = LayerThreshold; + } + } else { + if (StrokeThreshold == 0) { + actualRelativeThreshold = LayerThreshold; + } + } + int PointCount = 0; + numberOfSubStrokes = 0; + int Number_Of_Points_To_Process = Number_of_Points - 1; + // while (PointCount < Number_of_Points) { + do { + while (*pactualPressure++ < actualRelativeThreshold) { + // pactualPressure++; + PointCount++; + if (PointCount > Number_Of_Points_To_Process) { + break; + } + } + if (PointCount > Number_Of_Points_To_Process) break; + *pactualStrokeIndex++ = PointCount; + numberOfSubStrokes++; + pactualPressure--; + while (*pactualPressure++ > actualRelativeThreshold) { + // pactualPressure++; + PointCount++; + if (PointCount > Number_Of_Points_To_Process) { + break; + } + } + if ((PointCount - *(pactualStrokeIndex-1)) < 2) { + numberOfSubStrokes--; + pactualStrokeIndex--; + } else { + *pactualStrokeIndex++ = PointCount - 1; + } + } while ((PointCount <= Number_Of_Points_To_Process)); + Number_of_Points_in_Substroke = *(SensitivityStrokeIndexList+1) - *SensitivityStrokeIndexList + 1; + } + return (numberOfSubStrokes == 0); +} + +void PaperInkConverter::freeAllMemory() { + if (SensitivityStrokeIndexList != NULL) { + free(SensitivityStrokeIndexList); + SensitivityStrokeIndexList = NULL; + } + if (PenPosition_X != NULL) { + free(PenPosition_X); + PenPosition_X = NULL; + } + if (PenPosition_Y != NULL) { + free(PenPosition_Y); + PenPosition_Y = NULL; + } + if (PenPressure != NULL) { + free(PenPressure); + PenPressure = NULL; + } + if (PenTilt_X != NULL) { + free(PenTilt_X); + PenTilt_X = NULL; + } + if (PenTilt_Y != NULL) { + free(PenTilt_Y); + PenTilt_Y = NULL; + } +} + +PaperInkConverter::~PaperInkConverter() +{ + freeAllMemory(); +} + +int PaperInkConverter::EOF_Found() +{ + if (FileClose) { + freeAllMemory(); + return(MANAGED_TRUE); + } else { + return(MANAGED_FALSE); + } +} + +short* PaperInkConverter::GetPenPositionX() { + short* temp = pPenPositionStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; +short* PaperInkConverter::GetPenPositionY() { + short* temp = pPenPositionStart_Y + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; +short* PaperInkConverter::GetPenPressure() { + short* temp = pPenPositionStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +unsigned char* PaperInkConverter::GetPenTiltX() { + unsigned char* temp = pPenTiltStart_X + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +unsigned char* PaperInkConverter::GetPenTiltY() { + unsigned char* temp = pPenTiltStart_Y + *(SensitivityStrokeIndexList+SubStrokeIndex); + return(temp); + }; + +int PaperInkConverter::ReadNextStroke() { +/* + StrokeMaximum.x = 0x7FFFFFF; + StrokeMaximum.y = 0x7FFFFFF; + + StrokeMinimum.x = -0x7FFFFFF; + StrokeMinimum.y = -0x7FFFFFF; + + StrokeStart.x = 0; + StrokeStart.y = 0; + pPenPositionStart_X = pPenPosition_X = &PenPosition_X[0];; + pPenPositionStart_Y = pPenPosition_Y = &PenPosition_Y[0];; + pPenPressureStart = pPenPressure = &PenPressure[0]; + + pPenTiltStart_X = pPenTilt_X = &PenTilt_X[0]; + pPenTiltStart_Y = pPenTilt_Y = &PenTilt_Y[0]; +*/ + + bool BlockAvailable = true; + int Blockstatus = 0; // Set Block Status to Strokes available + numberOfSubStrokes--; + if (numberOfSubStrokes <= 0) { + Blockstatus = ReadNextCompleteStroke(); + } else { + SubStrokeIndex = SubStrokeIndex + 2; + Number_of_Points_in_Substroke = *(SensitivityStrokeIndexList+SubStrokeIndex+1) - *(SensitivityStrokeIndexList+SubStrokeIndex) + 1; + + } + + return Blockstatus; +} +int PaperInkConverter::ReadNextCompleteStroke() { +/* testpoints + pactualStroke->Max.x = -0x7FFFFFF; + pactualStroke->Max.y = -0x7FFFFFF; + + pactualStroke->Min.x = 0x7FFFFFF; + pactualStroke->Min.y = 0x7FFFFFF; + + pactualStroke->Start.x = 0; + pactualStroke->Start.y = 0; +*/ + + FullStrokeMaximum.x = 0x7FFFFFF; + FullStrokeMaximum.y = 0x7FFFFFF; + + FullStrokeMinimum.x = -0x7FFFFFF; + FullStrokeMinimum.y = -0x7FFFFFF; + + FullStrokeStart.x = 0; + FullStrokeStart.y = 0; + + pPenPositionStart_X = pPenPosition_X = PenPosition_X; + pPenPositionStart_Y = pPenPosition_Y = PenPosition_Y; + pPenPressureStart = pPenPressure = PenPressure; + + pPenTiltStart_X = pPenTilt_X = PenTilt_X; + pPenTiltStart_Y = pPenTilt_Y = PenTilt_Y; + + maxStrokePressure = 0; + + Descriptor = 0; + Number_of_Points = 0; + bool NoPointsInStroke = true; + int BlockAvailable; + int StrokeStatus; + do { + StrokeStatus = findStrokeStart(); + BlockAvailable = StrokeStatus; + while (BlockAvailable != 2) { // while More Strokes Available + BlockAvailable = ReadGraphicBlock(); // it only returns 0 and 2; + if (BlockAvailable == 0) { + if ( (Descriptor == 97) ) { // Descriptor 97 Contains Position x and Position y + // Position x in 1 mm Increments + // Position y in 2 mm Increments + // Format : + // 96 06 Position x Position Y + // 1 1 2 2 Byte + // + // + // int Posx = (((int)(char) (*pConvertStart++)) << 8); + // Posx = Posx + (int)(*pConvertStart++) + 5 ; // Get Pos x + int Posx = (((int)(char) GraphicBlockMem[0]) << 8); + Posx = Posx + (int)(GraphicBlockMem[1]) + 5 ; // Get Pos x + // int Posy = (((int)(char) (*pConvertStart++)) << 8); + // Posy = ((Posy + (int)(*pConvertStart++)) << 1) + 5 ; // Get Pos y + int Posy = (((int)(char) GraphicBlockMem[2]) << 8); + Posy = ((Posy + (int)GraphicBlockMem[3]) << 1) + 5 ; // Get Pos y + // pactualPoint->MySinglePoint.x = Posx; + // pactualPoint->MySinglePoint.y = Posy; + *pPenPosition_X = Posx; + *pPenPosition_Y = Posy; + } else if ( (Descriptor == 100) ){ // Descriptor 100 contains Pen Pressur + // Format : + // 100 06 unknown unknown Pressur + // 1 1 1 1 2 Byte + // + // + int Pressure = (((int)GraphicBlockMem[2]) << 8); + Pressure = Pressure + (int)(GraphicBlockMem[3]); // Get Pressure + + if (Pressure > maxStrokePressure) { + maxStrokePressure = Pressure; + } + *pPenPressure = Pressure; + // move Pressure to one Position set first position + } else if ( (Descriptor == 101) ){ // Descriptor 101 Contains Pen Tilt x and Pen Tilt y of the pen + // Format : + // 101 06 Tilt x Tilt Y u u + // 1 1 1 1 1 1 Byte + // + // + + int Tilt_x = GraphicBlockMem[0]; // Get Tilt x + int Tilt_y = GraphicBlockMem[1]; // Get Tilt y + + *pPenTilt_X = Tilt_x; + *pPenTilt_Y = Tilt_y; + // Recalculate Mininum and Maximum + Number_of_Points++; // Increment Number of Points + + if (*pPenPosition_X < FullStrokeMaximum.x) { + FullStrokeMaximum.x = *pPenPosition_X; + } + if (*pPenPosition_Y < FullStrokeMinimum.y) { + FullStrokeMinimum.y = *pPenPosition_Y; + } + if (*pPenPosition_X > FullStrokeMaximum.x) { + FullStrokeMaximum.x = *pPenPosition_X; + } + if (*pPenPosition_Y > FullStrokeMaximum.y) { + FullStrokeMaximum.y = *pPenPosition_Y; + } + + if (Number_of_Points < MaxStoreBuffer) { + pPenPosition_X++; + pPenPosition_Y++; + pPenPressure++; + pPenTilt_X++; + pPenTilt_Y++; + } else { + // ignore this points + // to do insert Error Message + } + } else if ( (Descriptor == 241) ) { + int LayerDescriptor = GraphicBlockMem[0]; + if (LayerDescriptor == 0) { // Stroke End Found + break; + } + } else { + // Unknown Identifier + // ignore this block + } + } + } + if (Number_of_Points > 0) { + if (maxStrokePressure > maxLayerPressure) { + maxLayerPressure = maxStrokePressure; + LayerThreshold = (maxLayerPressure * AllThreshold) >> 14; + } + NoPointsInStroke = RecalcalateStrokesWithThreshold(); + } + } while (NoPointsInStroke && (BlockAvailable == 0)); + return StrokeStatus; +} diff --git a/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.h b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.h new file mode 100644 index 0000000..d2dbdb8 --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.h @@ -0,0 +1,86 @@ + +#define MANAGED_TRUE 1 +#define MANAGED_FALSE 0 + +typedef struct MySinglePoint { + int x; + int y; +} MySinglePoint; + +class PaperInkConverter { +private: + FILE* f; + bool FileClose; +short* pPenPosition_X; +short* pPenPosition_Y; +short* pPenPressure; + +unsigned char* pPenTilt_X; +unsigned char* pPenTilt_Y; + +short* pPenPositionStart_X; +short* pPenPositionStart_Y; +short* pPenPressureStart; + +unsigned char* pPenTiltStart_X; +unsigned char* pPenTiltStart_Y; + +short* SensitivityStrokeIndexList; +#define MaxStoreBuffer 20000 +short* PenPosition_X; +short* PenPosition_Y; +short* PenPressure; +unsigned char* PenTilt_X; +unsigned char* PenTilt_Y; + + + +int Number_of_Points; +int numberOfSubStrokes; +int Number_of_Points_in_Substroke; +// int SensitivityStrokeIndex; +int SubStrokeIndex; + +MySinglePoint FullStrokeMaximum; +MySinglePoint FullStrokeMinimum; +MySinglePoint FullStrokeStart; + +int AllThreshold; // Contains Threshold in % * 16384 / 100 (2**14) +int StrokeThreshold; // Contains Threshold in % * 16384 / 100 (2**14 + +int maxStrokePressure; + +int maxLayerPressure; +int LayerThreshold; + +int maxSlidingPressure; + + + int Layer; + int BlockSize; + int Descriptor; + unsigned char GraphicBlockMem[256]; + + int ReadGraphicBlock(); + bool RecalcalateStrokesWithThreshold(); + int ReadNextCompleteStroke(); + int findStrokeStart(); + void PaperInkConverter::freeAllMemory(); + +public: + PaperInkConverter(wchar_t* filename, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); + ~PaperInkConverter(); + int EOF_Found(); + void SetAllSensitivity(int Sensitivity) { AllThreshold = Sensitivity * 164; }; // Threshold in % * 16384 / 100 (2**14); + void SetStrokeSensitivity(int Sensitivity) { StrokeThreshold = Sensitivity * 164; }; // Threshold in % * 16384 / 100 (2**14) + int ReadNextStroke(); + int GetLayer() {return(Layer);}; + int GetNumberOfPoints() {return(Number_of_Points_in_Substroke);}; + + short* GetPenPositionX(); + short* GetPenPositionY(); + short* GetPenPressure(); + unsigned char* GetPenTiltX(); + unsigned char* GetPenTiltY(); +}; + diff --git a/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj new file mode 100644 index 0000000..28885f1 --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {0A3B074B-898C-49FA-B558-D2FA29884CC0} + Win32Proj + PaperInkConverter + + + + StaticLibrary + true + Unicode + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + $(Platform)\$(Configuration)\ + + + $(Platform)\$(Configuration)\ + + + $(Platform)\$(Configuration)\ + + + $(Platform)\$(Configuration)\ + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + $(SolutionDir)\PaperInkConverter + $(SolutionDir)\PaperInkConverter + + + + + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.filters b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.filters new file mode 100644 index 0000000..605c0d9 --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.user b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/PaperInkConverter.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkConverter/ReadMe.txt b/PaperInkRecognizer/PaperInkConverter/ReadMe.txt new file mode 100644 index 0000000..b5d94ad --- /dev/null +++ b/PaperInkRecognizer/PaperInkConverter/ReadMe.txt @@ -0,0 +1,29 @@ +======================================================================== + STATIC LIBRARY : PaperInkConverter Project Overview +======================================================================== + +AppWizard has created this PaperInkConverter library project for you. + +No source files were created as part of your project. + + +PaperInkConverter.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +PaperInkConverter.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/PaperInkRecognizer/PaperInkRecognizer.sln b/PaperInkRecognizer/PaperInkRecognizer.sln new file mode 100644 index 0000000..11c70e1 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer.sln @@ -0,0 +1,108 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PaperInkConverter", "PaperInkConverter\PaperInkConverter.vcxproj", "{0A3B074B-898C-49FA-B558-D2FA29884CC0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeneralInkRecognizer", "GeneralInkRecognizer\GeneralInkRecognizer.vcxproj", "{8C9289A5-F0E4-46E1-A110-477E60BBEA92}" + ProjectSection(ProjectDependencies) = postProject + {0A3B074B-898C-49FA-B558-D2FA29884CC0} = {0A3B074B-898C-49FA-B558-D2FA29884CC0} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaperInkRecognizer", "PaperInkRecognizer\PaperInkRecognizer.csproj", "{C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup-32", "Setup-32\Setup-32.vdproj", "{8D75E507-8858-4A78-9892-A53408071D7C}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup-64", "Setup-64\Setup-64.vdproj", "{B10B45A4-0F8B-4AD2-B235-D464E580AA8F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InkAnalyser32", "InkAnalyser32\InkAnalyser32.vcxproj", "{39302845-AC68-4395-80C0-83B063854810}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|Win32.ActiveCfg = Debug|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|Win32.Build.0 = Debug|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|x64.ActiveCfg = Debug|x64 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|x64.Build.0 = Debug|x64 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Debug|x86.ActiveCfg = Debug|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|Mixed Platforms.Build.0 = Release|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|Win32.ActiveCfg = Release|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|Win32.Build.0 = Release|Win32 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|x64.ActiveCfg = Release|x64 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|x64.Build.0 = Release|x64 + {0A3B074B-898C-49FA-B558-D2FA29884CC0}.Release|x86.ActiveCfg = Release|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|Win32.ActiveCfg = Debug|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|Win32.Build.0 = Debug|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|x64.ActiveCfg = Debug|x64 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|x64.Build.0 = Debug|x64 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Debug|x86.ActiveCfg = Debug|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|Mixed Platforms.Build.0 = Release|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|Win32.ActiveCfg = Release|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|Win32.Build.0 = Release|Win32 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|x64.ActiveCfg = Release|x64 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|x64.Build.0 = Release|x64 + {8C9289A5-F0E4-46E1-A110-477E60BBEA92}.Release|x86.ActiveCfg = Release|Win32 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|Win32.ActiveCfg = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|Win32.Build.0 = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|x64.ActiveCfg = Debug|x64 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|x64.Build.0 = Debug|x64 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|x86.ActiveCfg = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Debug|x86.Build.0 = Debug|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|Mixed Platforms.Build.0 = Release|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|Win32.ActiveCfg = Release|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|Win32.Build.0 = Release|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|x64.ActiveCfg = Release|x64 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|x64.Build.0 = Release|x64 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|x86.ActiveCfg = Release|x86 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}.Release|x86.Build.0 = Release|x86 + {8D75E507-8858-4A78-9892-A53408071D7C}.Debug|Mixed Platforms.ActiveCfg = Debug + {8D75E507-8858-4A78-9892-A53408071D7C}.Debug|Win32.ActiveCfg = Debug + {8D75E507-8858-4A78-9892-A53408071D7C}.Debug|x64.ActiveCfg = Debug + {8D75E507-8858-4A78-9892-A53408071D7C}.Debug|x86.ActiveCfg = Debug + {8D75E507-8858-4A78-9892-A53408071D7C}.Release|Mixed Platforms.ActiveCfg = Release + {8D75E507-8858-4A78-9892-A53408071D7C}.Release|Win32.ActiveCfg = Release + {8D75E507-8858-4A78-9892-A53408071D7C}.Release|x64.ActiveCfg = Release + {8D75E507-8858-4A78-9892-A53408071D7C}.Release|x86.ActiveCfg = Release + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Debug|Mixed Platforms.ActiveCfg = Debug + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Debug|Win32.ActiveCfg = Debug + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Debug|x64.ActiveCfg = Debug + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Debug|x86.ActiveCfg = Debug + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Release|Mixed Platforms.ActiveCfg = Release + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Release|Win32.ActiveCfg = Release + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Release|x64.ActiveCfg = Release + {B10B45A4-0F8B-4AD2-B235-D464E580AA8F}.Release|x86.ActiveCfg = Release + {39302845-AC68-4395-80C0-83B063854810}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|Win32.ActiveCfg = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|Win32.Build.0 = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|x64.ActiveCfg = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|x64.Build.0 = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Debug|x86.ActiveCfg = Debug|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|Mixed Platforms.Build.0 = Release|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|Win32.ActiveCfg = Release|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|x64.ActiveCfg = Release|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|x64.Build.0 = Release|Win32 + {39302845-AC68-4395-80C0-83B063854810}.Release|x86.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PaperInkRecognizer/PaperInkRecognizer/About.Designer.cs b/PaperInkRecognizer/PaperInkRecognizer/About.Designer.cs new file mode 100644 index 0000000..c3c0ed3 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/About.Designer.cs @@ -0,0 +1,126 @@ +namespace PaperInkRecognizer +{ + partial class AboutBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Author = new System.Windows.Forms.Label(); + this.Product = new System.Windows.Forms.Label(); + this.Version = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // Author + // + this.Author.AutoSize = true; + this.Author.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Author.Location = new System.Drawing.Point(20, 38); + this.Author.Name = "Author"; + this.Author.Size = new System.Drawing.Size(61, 20); + this.Author.TabIndex = 0; + this.Author.Text = "Author:"; + // + // Product + // + this.Product.AutoSize = true; + this.Product.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Product.Location = new System.Drawing.Point(20, 111); + this.Product.Name = "Product"; + this.Product.Size = new System.Drawing.Size(68, 20); + this.Product.TabIndex = 0; + this.Product.Text = "Product:"; + // + // Version + // + this.Version.AutoSize = true; + this.Version.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Version.Location = new System.Drawing.Point(20, 183); + this.Version.Name = "Version"; + this.Version.Size = new System.Drawing.Size(67, 20); + this.Version.TabIndex = 0; + this.Version.Text = "Version:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(111, 38); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(133, 20); + this.label1.TabIndex = 0; + this.label1.Text = "Ellebruch Herbert"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(111, 111); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(142, 20); + this.label2.TabIndex = 0; + this.label2.Text = "Paper Ink Analyzer"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(111, 183); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(31, 20); + this.label3.TabIndex = 0; + this.label3.Text = "1.0"; + // + // AboutBox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.label3); + this.Controls.Add(this.Version); + this.Controls.Add(this.label2); + this.Controls.Add(this.Product); + this.Controls.Add(this.label1); + this.Controls.Add(this.Author); + this.Name = "AboutBox"; + this.Text = "About"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label Author; + private System.Windows.Forms.Label Product; + private System.Windows.Forms.Label Version; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + } +} \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/About.cs b/PaperInkRecognizer/PaperInkRecognizer/About.cs new file mode 100644 index 0000000..5ced7ee --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/About.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace PaperInkRecognizer +{ + public partial class AboutBox : Form + { + public AboutBox() + { + InitializeComponent(); + } + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/About.resx b/PaperInkRecognizer/PaperInkRecognizer/About.resx new file mode 100644 index 0000000..5ea0895 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/About.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/ClassDiagram1.cd b/PaperInkRecognizer/PaperInkRecognizer/ClassDiagram1.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/ClassDiagram1.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.Designer.cs b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.Designer.cs new file mode 100644 index 0000000..e87bac3 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.Designer.cs @@ -0,0 +1,489 @@ +namespace PaperInkRecognizer +{ + partial class GeneralLayout + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GeneralLayout)); + this.LayoutArea = new System.Windows.Forms.SplitContainer(); + this.hInkHScrollBar = new System.Windows.Forms.HScrollBar(); + this.richRecognizedTextBox = new System.Windows.Forms.RichTextBox(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FileMenueOpenFile = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripAnalyze = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSendToMathPanel = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyInkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripLayer = new System.Windows.Forms.ToolStripMenuItem(); + this.loadNextLayerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addNextLayerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openInkFile = new System.Windows.Forms.OpenFileDialog(); + this.LayoutArea.Panel1.SuspendLayout(); + this.LayoutArea.Panel2.SuspendLayout(); + this.LayoutArea.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // LayoutArea + // + this.LayoutArea.Dock = System.Windows.Forms.DockStyle.Fill; + this.LayoutArea.Location = new System.Drawing.Point(0, 24); + this.LayoutArea.Name = "LayoutArea"; + // + // LayoutArea.Panel1 + // + this.LayoutArea.Panel1.BackColor = System.Drawing.SystemColors.Window; + this.LayoutArea.Panel1.Controls.Add(this.hInkHScrollBar); + // + // LayoutArea.Panel2 + // + this.LayoutArea.Panel2.Controls.Add(this.richRecognizedTextBox); + this.LayoutArea.Size = new System.Drawing.Size(938, 401); + this.LayoutArea.SplitterDistance = 455; + this.LayoutArea.TabIndex = 0; + // + // hInkHScrollBar + // + this.hInkHScrollBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hInkHScrollBar.Location = new System.Drawing.Point(0, 384); + this.hInkHScrollBar.Name = "hInkHScrollBar"; + this.hInkHScrollBar.Size = new System.Drawing.Size(455, 17); + this.hInkHScrollBar.TabIndex = 0; + this.hInkHScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.hInkHScrollBar_Scroll); + // + // richRecognizedTextBox + // + this.richRecognizedTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.richRecognizedTextBox.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.richRecognizedTextBox.Location = new System.Drawing.Point(0, 0); + this.richRecognizedTextBox.Name = "richRecognizedTextBox"; + this.richRecognizedTextBox.Size = new System.Drawing.Size(479, 401); + this.richRecognizedTextBox.TabIndex = 0; + this.richRecognizedTextBox.Text = ""; + this.richRecognizedTextBox.WordWrap = false; + this.richRecognizedTextBox.VScroll += new System.EventHandler(this.richRecognizedTextBox_VScroll); + // + // menuStrip1 + // + this.menuStrip1.BackColor = System.Drawing.SystemColors.Control; + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem, + this.toolStripLayer, + this.toolsToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(938, 24); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FileMenueOpenFile, + this.toolStripSeparator, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripSeparator1, + this.printToolStripMenuItem, + this.printPreviewToolStripMenuItem, + this.toolStripSeparator2, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // FileMenueOpenFile + // + this.FileMenueOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("FileMenueOpenFile.Image"))); + this.FileMenueOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta; + this.FileMenueOpenFile.Name = "FileMenueOpenFile"; + this.FileMenueOpenFile.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.FileMenueOpenFile.Size = new System.Drawing.Size(146, 22); + this.FileMenueOpenFile.Text = "&Open"; + this.FileMenueOpenFile.Click += new System.EventHandler(this.FileMenueOpenFile_Click); + // + // toolStripSeparator + // + this.toolStripSeparator.Name = "toolStripSeparator"; + this.toolStripSeparator.Size = new System.Drawing.Size(143, 6); + this.toolStripSeparator.Visible = false; + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); + this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.saveToolStripMenuItem.Text = "&Save"; + this.saveToolStripMenuItem.Visible = false; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.saveAsToolStripMenuItem.Text = "Save &As"; + this.saveAsToolStripMenuItem.Visible = false; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(143, 6); + this.toolStripSeparator1.Visible = false; + // + // printToolStripMenuItem + // + this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image"))); + this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.printToolStripMenuItem.Name = "printToolStripMenuItem"; + this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.printToolStripMenuItem.Text = "&Print"; + this.printToolStripMenuItem.Visible = false; + // + // printPreviewToolStripMenuItem + // + this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); + this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; + this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; + this.printPreviewToolStripMenuItem.Visible = false; + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.undoToolStripMenuItem, + this.redoToolStripMenuItem, + this.toolStripAnalyze, + this.toolStripSendToMathPanel, + this.toolStripSeparator3, + this.cutToolStripMenuItem, + this.copyToolStripMenuItem, + this.copyInkToolStripMenuItem, + this.pasteToolStripMenuItem, + this.toolStripSeparator4, + this.selectAllToolStripMenuItem}); + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.editToolStripMenuItem.Text = "&Edit"; + // + // undoToolStripMenuItem + // + this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; + this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.undoToolStripMenuItem.Text = "&Undo"; + this.undoToolStripMenuItem.Visible = false; + // + // redoToolStripMenuItem + // + this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; + this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); + this.redoToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.redoToolStripMenuItem.Text = "&Redo"; + this.redoToolStripMenuItem.Visible = false; + // + // toolStripAnalyze + // + this.toolStripAnalyze.Name = "toolStripAnalyze"; + this.toolStripAnalyze.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.toolStripAnalyze.Size = new System.Drawing.Size(222, 22); + this.toolStripAnalyze.Text = "Analyze"; + this.toolStripAnalyze.Click += new System.EventHandler(this.toolStripAnalyze_Click); + // + // toolStripSendToMathPanel + // + this.toolStripSendToMathPanel.Name = "toolStripSendToMathPanel"; + this.toolStripSendToMathPanel.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M))); + this.toolStripSendToMathPanel.Size = new System.Drawing.Size(222, 22); + this.toolStripSendToMathPanel.Text = "Send to &Math Panel"; + this.toolStripSendToMathPanel.Visible = false; + this.toolStripSendToMathPanel.Click += new System.EventHandler(this.toolStripSendToMathPanel_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(219, 6); + this.toolStripSeparator3.Visible = false; + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); + this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.cutToolStripMenuItem.Text = "Cu&t"; + this.cutToolStripMenuItem.Visible = false; + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); + this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.copyToolStripMenuItem.Text = "&Copy"; + this.copyToolStripMenuItem.Visible = false; + // + // copyInkToolStripMenuItem + // + this.copyInkToolStripMenuItem.Name = "copyInkToolStripMenuItem"; + this.copyInkToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.C))); + this.copyInkToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.copyInkToolStripMenuItem.Text = "Copy Ink"; + this.copyInkToolStripMenuItem.Click += new System.EventHandler(this.copyInkToolStripMenuItem_Click); + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); + this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.pasteToolStripMenuItem.Text = "&Paste"; + this.pasteToolStripMenuItem.Visible = false; + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(219, 6); + this.toolStripSeparator4.Visible = false; + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(222, 22); + this.selectAllToolStripMenuItem.Text = "Select &All"; + this.selectAllToolStripMenuItem.Visible = false; + // + // toolStripLayer + // + this.toolStripLayer.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.loadNextLayerToolStripMenuItem, + this.addNextLayerToolStripMenuItem}); + this.toolStripLayer.Name = "toolStripLayer"; + this.toolStripLayer.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.toolStripLayer.Size = new System.Drawing.Size(47, 20); + this.toolStripLayer.Text = "&Layer"; + // + // loadNextLayerToolStripMenuItem + // + this.loadNextLayerToolStripMenuItem.Name = "loadNextLayerToolStripMenuItem"; + this.loadNextLayerToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.loadNextLayerToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.loadNextLayerToolStripMenuItem.Text = "&Load Next Layer"; + this.loadNextLayerToolStripMenuItem.Click += new System.EventHandler(this.loadNextLayerToolStripMenuItem_Click); + // + // addNextLayerToolStripMenuItem + // + this.addNextLayerToolStripMenuItem.Name = "addNextLayerToolStripMenuItem"; + this.addNextLayerToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.addNextLayerToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.addNextLayerToolStripMenuItem.Text = "&Add Next Layer"; + this.addNextLayerToolStripMenuItem.Click += new System.EventHandler(this.addNextLayerToolStripMenuItem_Click); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.customizeToolStripMenuItem, + this.optionsToolStripMenuItem}); + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.toolsToolStripMenuItem.Text = "&Tools"; + // + // customizeToolStripMenuItem + // + this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem"; + this.customizeToolStripMenuItem.Size = new System.Drawing.Size(130, 22); + this.customizeToolStripMenuItem.Text = "&Customize"; + this.customizeToolStripMenuItem.Visible = false; + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(130, 22); + this.optionsToolStripMenuItem.Text = "&Options"; + this.optionsToolStripMenuItem.Visible = false; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contentsToolStripMenuItem, + this.indexToolStripMenuItem, + this.searchToolStripMenuItem, + this.toolStripSeparator5, + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "&Help"; + // + // contentsToolStripMenuItem + // + this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem"; + this.contentsToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.contentsToolStripMenuItem.Text = "&Contents"; + this.contentsToolStripMenuItem.Visible = false; + // + // indexToolStripMenuItem + // + this.indexToolStripMenuItem.Name = "indexToolStripMenuItem"; + this.indexToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.indexToolStripMenuItem.Text = "&Index"; + this.indexToolStripMenuItem.Visible = false; + // + // searchToolStripMenuItem + // + this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; + this.searchToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.searchToolStripMenuItem.Text = "&Search"; + this.searchToolStripMenuItem.Visible = false; + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(119, 6); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.aboutToolStripMenuItem.Text = "&About..."; + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); + // + // openInkFile + // + this.openInkFile.Filter = "Ink File (*.wpi)|*.wpi"; + this.openInkFile.FileOk += new System.ComponentModel.CancelEventHandler(this.openInkFile_FileOk); + // + // GeneralLayout + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(938, 425); + this.Controls.Add(this.LayoutArea); + this.Controls.Add(this.menuStrip1); + this.Name = "GeneralLayout"; + this.Text = "PaperInkRecognition"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GeneralLayout_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GeneralLayout_FormClosed); + this.Load += new System.EventHandler(this.GeneralLayout_Load); + this.LayoutArea.Panel1.ResumeLayout(false); + this.LayoutArea.Panel2.ResumeLayout(false); + this.LayoutArea.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.SplitContainer LayoutArea; + private System.Windows.Forms.RichTextBox richRecognizedTextBox; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem FileMenueOpenFile; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.OpenFileDialog openInkFile; + private System.Windows.Forms.ToolStripMenuItem toolStripAnalyze; + private System.Windows.Forms.ToolStripMenuItem toolStripSendToMathPanel; + private System.Windows.Forms.ToolStripMenuItem copyInkToolStripMenuItem; + private System.Windows.Forms.HScrollBar hInkHScrollBar; + private System.Windows.Forms.ToolStripMenuItem toolStripLayer; + private System.Windows.Forms.ToolStripMenuItem loadNextLayerToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addNextLayerToolStripMenuItem; + } +} + diff --git a/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.cs b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.cs new file mode 100644 index 0000000..91e249a --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace PaperInkRecognizer +{ + enum LineStatus + { + Empty, + BulletStart, + BulletContinue, + Normal + + }; + + struct LineLayout + { + public LineStatus Status; + public int LineHeight; + public Rectangle BulletPosition; + public ArrayList LineContents; + }; + + struct TextLayout + { + public Point TextStart; + public String LineString; + } + + public partial class GeneralLayout : Form + { + + // Declare Values for the Text Layout + PaperInkAnalysedPage aCompletePaperInkPage; + PaperInkFile OpenedFile;// todo remove this? + bool InkPagExists; + + public GeneralLayout() + { + InitializeComponent(); + } + + private void GeneralLayout_Load(object sender, EventArgs e) + { + + +#if FileAutoLoad + // for Testing only + int x = 1; + String FileOpened = "D:\\ink\\Multi\\SKETCH39.wpi"; + int RelativThreshold = 9; + int AbsoluteThreshold = 10; + int SlidingThreshold = 0; + OpenedFile = new PaperInkFile(FileOpened, RelativThreshold, AbsoluteThreshold, SlidingThreshold); + IntPtr DasInkHandel = LayoutArea.Panel1.Handle; + aInkPage = new PaperInkPage(OpenedFile, DasInkHandel, ref richRecognizedTextBox); + InkPagExists = true; + aInkPage.AddStokesFromFileAndDisplay(OpenedFile); +#else + InkPagExists = false; +#endif + + } + + private void GeneralLayout_FormClosed(object sender, FormClosedEventArgs e) + { + } + + private void richRecognizedTextBox_VScroll(object sender, EventArgs e) + { + // http://www.codeproject.com/Articles/7830/Scrolling-Around-with-the-RichTextBox-Control + aCompletePaperInkPage.MoveInk(hInkHScrollBar.Handle, richRecognizedTextBox.Handle); + LayoutArea.Panel1.Refresh(); + } + + private void FileMenueOpenFile_Click(object sender, EventArgs e) + { + openInkFile.ShowDialog(); + } + + private void openInkFile_FileOk(object sender, CancelEventArgs e) + { + String FileOpened = openInkFile.FileName; + int StrokeThreshold = 9; + int AllThreshold = 10; + int SlidingThreshold = 0; + OpenedFile = new PaperInkFile(FileOpened, StrokeThreshold, AllThreshold, SlidingThreshold); + if (OpenedFile.EOFfound()) { + MessageBox.Show("Cannot open File or no valid ink file"); + } else { + IntPtr aInkHandel = LayoutArea.Panel1.Handle; + if (InkPagExists) + { + hInkHScrollBar.Value = 0; // Set Scrollbar to the left side + aCompletePaperInkPage.ClearPage(); + } + else + { + aCompletePaperInkPage = new PaperInkAnalysedPage( aInkHandel, ref richRecognizedTextBox); + InkPagExists = true; + } + + aCompletePaperInkPage.AddStokesFromInkFile(OpenedFile); + LayoutArea.Panel1.Refresh(); + } + + } + + private void toolStripAnalyze_Click(object sender, EventArgs e) + { + aCompletePaperInkPage.AnalyzeInkPage(); + + LayoutArea.Panel1.Refresh(); + } + + private void GeneralLayout_FormClosing(object sender, FormClosingEventArgs e) + { + } + + private void toolStripSendToMathPanel_Click(object sender, EventArgs e) + { + aCompletePaperInkPage.PageToMathInputPanel(); + } + + private void copyInkToolStripMenuItem_Click(object sender, EventArgs e) + { + aCompletePaperInkPage.CopyToClipboard(); + + } + + private void hInkHScrollBar_Scroll(object sender, ScrollEventArgs e) + { + // For test only int position = hInkHScrollBar.Value; + // For test only if (position > 10) + // For test only { + // IntPtr ScrollHandle = hInkHScrollBar.Handle; + aCompletePaperInkPage.MoveInk(hInkHScrollBar.Handle, richRecognizedTextBox.Handle); + LayoutArea.Panel1.Refresh(); + + // For test only } + } + + private void loadNextLayerToolStripMenuItem_Click(object sender, EventArgs e) + { + if (OpenedFile.EOFfound()) + { + MessageBox.Show("NO more Layer"); + } + else + { + hInkHScrollBar.Value = 0; // Set Scrollbar to the left side + aCompletePaperInkPage.ClearPage(); + aCompletePaperInkPage.AddStokesFromInkFile(OpenedFile); // add Strokes from File also call AnalyzePage + LayoutArea.Panel1.Refresh(); + } + } + + private void addNextLayerToolStripMenuItem_Click(object sender, EventArgs e) + { + if (OpenedFile.EOFfound()) + { + MessageBox.Show("NO more Layer"); + } + else + { + aCompletePaperInkPage.AddStokesFromInkFile(OpenedFile); // add Strokes from File also call AnalyzePage + LayoutArea.Panel1.Refresh(); + } + } + + private void aboutToolStripMenuItem_Click(object sender, EventArgs e) + { + AboutBox aAboutBox = new AboutBox(); + aAboutBox.Show(); + } + } +} \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.resx b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.resx new file mode 100644 index 0000000..c632fac --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/GeneralLayout.resx @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPlZNdSNNRGMb/F110ZZEVhVBgeeHNICiiuggp + olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdPKMgr7kApFItTUkWZqVhSVYmao5Nev/xyoQ4k88Nyc + 8z6/93nP4QjCfy6lwc4ltZVso4P/tMyXRcmMHqZ0EeY6jZQVInzuf0e1Tb9Ina3P/tkpLD6XkNg8BJe5 + u93C+HDVrP4M2ZkcMOOw5tLZ9nxJyJE4HSExBoKkBQhVpTrGhso9zNPfiph0JlB+U01ZcRbmwnRMeWlc + 08opUCV6QissGsZ+WOY6z4hmuuXglC6pRYBbJSp+fzXNxnaZ66o1s3rkyKHWruJuWRYOcwZ2kxKr8TI3 + DCkU6+QYNUnuNGWmLEY+5uOK3degoKZcx3SfEvozPfVB3OtNhi4ZvI2nrTIc23U9gtmYwa8eNXzScq8i + l6bHWnfRwhHeREJzGFONgYw/CeB9qQSZNNR9FyUGBT87lfQ3plJj1zLTq4COGDegLVo0HmeqKZjx+gOM + PNzDYPU2lLF+4jhyN6BIl8pgexK3bRpaXopJuhJEwGloiWDmVSgTLw4xWreXoZrtfK/wp/nKak4E+s6/ + hDFHTkd9GndsOdCTBq1i3NdHmWgIYvRpAMO1OxlwSPhi2YpT641CuoWzsSfnAfnZiVRZ1Tjvx9GsF+bU + pF1BvWolD9JXUZmyDnOiD1cvbCZiYXfXCPrMi+gVZ8hOiiL53DHORwdzKnw/hw/uYt9uCTskfvj7+rBp + 41rWr/Fig7fX8j/Tsn/fcgx/ARfG3ml6M3rzAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIsSURBVDhPrZPdS5NxFMf3L3TfTdBFtzU1hmuxGjzlHMqq + YVgRvT2RL+XSZZqoWJlGLV8gW+HSScvpJJxU+AamSI2hTCVLM1e0xKGm2EQw+PY7v+j5tTIvoh+cy8/n + POec76NS/Y/37GkUVL72ZbR5l/DYvYDGhgjuO2ZQW/MJ9tsh3CifQmnJBAoLXiMvdxQXzgeh9Cawtweo + qV7FRm9ldQ3GtF4cTnvCSxF4Wxe5oLLiy195giMLK9htfg61WoblkEcI3I/muaC05PO6gp/w+/Ai4kw+ + FFyexgFzkxA462e54JLt3R+CX+GRyQi2SV5Yc8aRmuIUgrq7YS7IzhqNEfwODwbD2Kx3Q5YDMJkcQlBd + 9ZEL5DMBRbAe3OP/gE2JDThy9AWSkmqF4GblNLq7wE4JHD/5CpZjA3zbtDCamT6bOv+A+3DQ0glJsgvB + 1bJJdPjAMgA0ub6xu39F+fU5vlRaGM2cmRFU4OTUdhgMFUJwpXAcnmbgoXONBScKY3pOTJlP2JB+roh3 + Tk5h8H4P9PoyIbDljTEYqLoT5Z1JwEKCOK2EobezGJuag5x7DXuNbRzW7nFBpysSAoql4x6UzyYBwWfz + b+FNaB6hmSVcLLYjXu9icCPidz2ANjFfCDIzhtncy3zmrQYPtuyQ0NLRD1/XILr7/Bh4OYR9JgvUunok + MHi7pg4ajVUIKNOnT/XzeFLCKCR0ZzoVbZsWRjNTVyqCdyZkxwr+9a/+Dk60OMVjMFpXAAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAItSURBVDhPtZP/T1JRGMb9p1itrVZbbRpqZbawnBENV1I0 + jGlByTSyKTXJwq2oKZQb1KAv6JCYWSxvdsklKVPETSAnSIQIqBBfnu69VGTA1tY62/vLe8/zfN77nHPK + yv7HcnmCML6aKVmG0WmU5NLiMdKNP1fyWxre5VU8MU+giispbaC3fMRmIoUv4Shs9lmmnllJ6EwE7DM+ + 1As7cfRMe3GDd45FEFOLW+A0eS2WgHMhAIOFROWJSzBZiUKDUCQOtYFAOpOFzx/aQjfbPoGc9qKuSY5a + vgw31M9xW2vOmzhmPYx4lHQxdJr6k+wPxeHyhHBPZ2X+XdYziAeGcVSdlOYMnPM+9GpHoDF9wF29DQ9f + vEevxoL2W3qIOtTgNitwgNpcUd+CY2evQdk/BLFcjf0NF3MGNwdeIhpPFKRON1LpDDaoQOkMguENLK3E + IO3WoLG1h5rgx0nI+4wwvZ7CU6sdGuMY7miH0al6DEl3P4RtKvAuKMBp6sBBnhTlx8U4R/XqBFexu1aY + m6BNqStKp5vR9SS8/jVMzgXx1hHAELEErqgLlQ2tYFWcyhlIFI8KDKgM8TWWwtzndYw7w2D3bYfuzQqT + /GH+FeyqEeQNWq4PIJkCKBjC8SyWI1ksBDKYcG9ieDKGQdsqlCwWVCMRxmAfR5QX0xOI5ffhpgT0x7+p + X6P//hhqGmWo5l0Gm7pl5dRx7eU0Y8+R89h5SIAd1aexjc1nqEXF//qavwMB2C9JXlZfHwAAAABJRU5E + rkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF/SURBVDhPndPNSwJBGAZw/wWvXboVdK5OHQo8ZNCte4QR + EWR4k4SuXaIOUWRKQSomiuFnrYWmFlQaEtnHoUMoWSQEYWX59cQ7y0rb7ko08DCH3fc3887uqPyJW/yO + N5qFi8vAHjjF+XUOqlaDipWG1X2IHq0OzkBCGdmJXSkCK3YOkeMsj/jj8oh7/0IRWN7aRe/QeDOynTjD + aUWgWquDEAGSBWz+E1kg91AEF0/Bsh1kcYcTyBeK0jY2vEkJQC9Sse+tCs8jH0e6wJCbu7wYWXdFJYAj + FGfFz3X+0RPqDBF2Impl1RGRAIu2UBMghEIg7cJoWhLvgA7o56CDI+DgEzhr8MU0E6CKlTAzO68MNBoN + vJcroBamMx8MoQjFJmsQ+qlJZeCrUsPLaxmpy3v4dpMMoVUpVGwwjGLTqJYHhO8tzAsWH/aiR6wd/ZwZ + wyMTiFs1QNksRqiAftW/RNvdiRLXxhCTrq/1JVO6gGODHQyhVv6NdLWroekfAOdZwzdA30JIPjsVIgAA + AABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGHSURBVDhPrdNNS0JREAbgfk3QpkVRCUUSFrUQFJSrEIRZ + pKWULSIlsgJTMD+SpF0tLIS6hhZIKBalkJmkUdqiL1OxTMFoXfCWV5BcdLlRsznDYeY5A8Opq/vvuEje + wen247v7kHnGJumtufvx3ZdiCabVjZpici+A8FmcGVCW7Wsk/EcRqiFfKEGmmkX68ZE5sOM9hvlrimwu + j2A4DpFEiaenHHPgIHSOJbsD2x4f1AsW9EtGmTeXx05nnzE1b8HwxByIgTHoDKbfAWVEoTaBkEyCkBsQ + PE0yBzKFDxhdbxDr01h03IKniUGoTcC6lUIkUaSHUvl3DNpeIdbdgyN1gD+6BqEmBN5MEj0KH5Y3Kpv5 + MYyuEgh9Dl0jHrSLbFAtusGbjlabWISNHhDrs9WCNoGZygXaa+okfVdo5CjpAUKXogq8oRRa+HoqH7de + olO6jYaOIdQ3NNEDqpUbsKUkmvlGsLmV3QciGbD6FGjplsK1H6MHDqM5cGXraO2Vw7l7wnx1f/nRn6qq + 3+OKoLtvAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHiSURBVDhPpZPRT5JRGMb9U0rHnHXtH9BaWa0222pe1EVb + 2briQq+6atlsyzVstIkhzcLSAfahtJbS0mESaQaJlIGTzBkslPEpiSDor+87LAnawM13e+7O+3uf55z3 + VFUdtBwT31AljQeELCNe+hwfCC//Yl9stbm0zMMerrc9J7i4XBliHwsU9ed2dunqf4PTHeBSS2dliGXU + JwDOEEifwR+WeWh+jTQpY5tIYHUleDKaQD8UFwquZIpd9Tk8ew4y2znkjTSRWFIASqt9YJX6Zje+hfUC + xGRziXO97m10IzK3pZ+0Pg3T/3btP0CLMYZjSuZo0zCf5uN5iEHJq+beTGVZTaRYiqzzNbyG6VVUADqk + nJBfmXpFF+VI00vqLgxS2/gsD1DzbqWze5O1phA3DF94YF0qciD/zrKwsoV7bgOjNIPm3OMCQE6mmf8e + wxeM4PH/YPzjIm29+ee9NZBEa4hy+X6I83dmhYzSNJoz3QVA/emrlKpVPysAWSVeLJFlLrzJmFfG/i7O + o0EPNQ368jtyrX1KAP6d/NdBt+091Sd05QEXb7pIZXYwDXnpsc9gfDEtJqvNBsskh4/fKw9o0DqV27YK + 1Taa0ZztoeZUF9UnO5XmDg4du1t5zff1mQ566A8dAOcMIXbZrQAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPtZNZSJRhFIZ/6MJuihbqqquC6CaKCKqLjMIs + TDOMxIysiRiVEpXJ0iE1NUUnt0nTxshlUHOrRFEpEiFxaNdwjBaJ1Mhpsuafcc/i6f8/GWxo86YDL+fm + vM9Z+D5J+h/R2ZxB+81UGssSmBe/oTIPt8pyjuCwVTFmu8ZgXzZntb7kpeu4YtBjTI/7FagaJ+V6pp11 + TDqqMRfrGB+pICclihdd8Zw/7U+8ZjO2zmOMtK4mOmy/J0QFqOZpZw1FGUfptmQjvy9guE/PW8sJmkoC + CQ/1pipxFU/zJCIP7/ME1FXkzALkGxgSw0jWhaCPCuZcZBA6bSAxGn8iQn3Ij14jACF+3p6A6lIDU3It + U3YT40OZ2J9HYa1YLtRbvozu4kU8MnoJsyqfbRs9AWZTBhP2MiYG0hh/eYqxZweRmxeTW95KpqmRC5dr + iTeYiUktITzBSFhsliegtDCV0UEjY31aRh/747q/iY+3VwizO6ZnvuFwTjIw7CA4IoWA4/o5SEluEvKr + NFwPfXF1rMfZtpLBckl0VqP0VqeQqaad3n6bMN/tsrInSDMLKcxK4HPPGZzt65BblmKv96L/uiTG/jrz + nS8upfMHB71vbFh63uEXGoOvYt619wDe23cg5V+Mw/4gQjEv4VPDQoYqF2AtkohWdlbHdk9wVZmgwNxG + U4dVZFVbN6xFupQcKx6I+8rurFUO9nPne5bXwlx/p5ua1idzAHWN3KSTygsLRBO0m4CdWwRZvba6s7vb + 77KY4E9xSLm2WvAvzeuz/a3oB0747y0N60d/AAAAAElFTkSuQmCC + + + + 132, 17 + + + 62 + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/PaperInkAnalyzer.cs b/PaperInkRecognizer/PaperInkRecognizer/PaperInkAnalyzer.cs new file mode 100644 index 0000000..f2a7717 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/PaperInkAnalyzer.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; + +namespace PaperInkRecognizer +{ + class PaperInkAnalyzer + { +#if DebugDLL +#if win32 + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern IntPtr NewPaperInkAnalyzer(InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + IntPtr DrawingWindowHandle); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool AddStrokesFromFile(IntPtr pInkRecognizerClass, IntPtr usedFile, int StrokeColor); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool DeleteAllStrokes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool AnalyzeInk(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool PositioningInkPanel(IntPtr pInkRecognizerClass, int Basic_X_Offset, int Basic_Y_Offset, IntPtr HorizontalScrollHandle, IntPtr VerticalScrollHandle); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool CopyToClipboard(IntPtr pInkRecognizerClass); + +#if NoCallback + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool WrapFindUpperLeftLinePosition(IntPtr pInkRecognizerClass, out int Min_X_Position_Left, out int Min_X_Position_Right, out int Min_Y_Position_TOP, out int Min_Y_PositionBottom); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkLineBoxes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkBullets(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkBulletsInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkDrawingBoxes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkInkDrawingHotSpots(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + +// [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] +// public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); +#endif + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern int DeletePaperInkAnalyzer(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool SendAllStrokesToMathInputPanel(IntPtr pInkRecognizerClass); + + +#else + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern IntPtr NewPaperInkAnalyzer(InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + IntPtr DrawingWindowHandle); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool AddStrokesFromFile(IntPtr pInkRecognizerClass, IntPtr usedFile, int StrokeColor); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool DeleteAllStrokes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool AnalyzeInk(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool PositioningInkPanel(IntPtr pInkRecognizerClass, int Basic_X_Offset, int Basic_Y_Offset, IntPtr HorizontalScrollHandle, IntPtr VerticalScrollHandle); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool CopyToClipboard(IntPtr pInkRecognizerClass); +#if NoCallback + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool WrapFindUpperLeftLinePosition(IntPtr pInkRecognizerClass, out int Min_X_Position_Left, out int Min_X_Position_Right, out int Min_Y_Position_TOP, out int Min_Y_PositionBottom); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkLineBoxes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkBullets(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkBulletsInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern int GetInkDrawingBoxes(IntPtr pInkRecognizerClass); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool GetNextInkInkDrawingHotSpots(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + // [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + // public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + +#endif + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern int DeletePaperInkAnalyzer(IntPtr pInkRecognizerClass); + + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool SendAllStrokesToMathInputPanel(IntPtr pInkRecognizerClass); +#endif +#else + [DllImport("GeneralInkRecognizer.dll")] + public static extern IntPtr NewPaperInkAnalyzer(InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + IntPtr DrawingWindowHandle); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool AddStrokesFromFile(IntPtr pInkRecognizerClass, IntPtr usedFile, int StrokeColor); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool DeleteAllStrokes(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool AnalyzeInk(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool PositioningInkPanel(IntPtr pInkRecognizerClass, int Basic_X_Offset, int Basic_Y_Offset, IntPtr HorizontalScrollHandle, IntPtr VerticalScrollHandle); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool CopyToClipboard(IntPtr pInkRecognizerClass); +#if NoCallback + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool WrapFindUpperLeftLinePosition(IntPtr pInkRecognizerClass, out int Min_X_Position_Left, out int Min_X_Position_Right, out int Min_Y_Position_TOP, out int Min_Y_PositionBottom); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern int GetInkLineBoxes(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern int GetInkBullets(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool GetNextInkBulletsInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern int GetInkDrawingBoxes(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool GetNextInkInkDrawingHotSpots(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + + // [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + // public static extern bool GetNextInkLineBoxInfo(IntPtr pInkRecognizerClass, int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText); + +#endif + + [DllImport("GeneralInkRecognizer.dll")] + public static extern int DeletePaperInkAnalyzer(IntPtr pInkRecognizerClass); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool SendAllStrokesToMathInputPanel(IntPtr pInkRecognizerClass); +#endif + + public IntPtr CInkAnalyzerClass; + + public PaperInkAnalyzer(InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunction, + InkInkDrawingInfo InkInkDrawingInfoFunction, + InkLineBoxInfo InkLineBoxInfoFunction, + InkBulletInfo InkBulletInfoFunction, + AnalyserHasFinished AnalyserHasFinishedFunction, + MathPanelReply MathPanelReplyFunction, + IntPtr DrawingWindowHandle) + { + CInkAnalyzerClass = NewPaperInkAnalyzer(InkAnalyzerResultAvailableFunction, + InkInkDrawingInfoFunction, + InkLineBoxInfoFunction, + InkBulletInfoFunction, + AnalyserHasFinishedFunction, + MathPanelReplyFunction, + DrawingWindowHandle); + } + + ~PaperInkAnalyzer() + { + DeletePaperInkAnalyzer(CInkAnalyzerClass); + } + + public bool AnalyzeInk() + { + return AnalyzeInk(CInkAnalyzerClass); + } + + public bool TransferStrokesToMathInputPanel() + { + return SendAllStrokesToMathInputPanel(CInkAnalyzerClass); + } + + public bool AddStrokesFromFile(PaperInkFile usedFile,Color StrokeColor) + { + int xyz = StrokeColor.ToArgb(); + return AddStrokesFromFile(CInkAnalyzerClass, usedFile.cFileClass, StrokeColor.ToArgb()); + } + + public bool DeleteAllStrokes() + { + return (DeleteAllStrokes(CInkAnalyzerClass)); + } + + public bool PositioningInkPanel(int Basic_X_Offset, int Basic_Y_Offset, IntPtr HorizontalScrollHandle, IntPtr VerticalScrollHandle) + { + return (PositioningInkPanel(CInkAnalyzerClass, Basic_X_Offset, Basic_Y_Offset, HorizontalScrollHandle, VerticalScrollHandle)); + } + + public bool CopyToClipboard() + { + return (CopyToClipboard(CInkAnalyzerClass)); + } + +#if NoCallback + public bool FindUpperLeftLinePosition(out int Min_X_Position_Left, out int Min_X_Position_Right, out int Min_Y_Position_TOP, out int Min_Y_PositionBottom) + { + return (WrapFindUpperLeftLinePosition(CInkAnalyzerClass, out Min_X_Position_Left, out Min_X_Position_Right, out Min_Y_Position_TOP, out Min_Y_PositionBottom)); + } + + public int GetInkLineBoxes() + { + return (GetInkLineBoxes(CInkAnalyzerClass)); + } + + public bool GetNextInkLineBoxInfo(int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText) + { + return (GetNextInkLineBoxInfo(CInkAnalyzerClass, BoxIndex, out Left, out Top, out width, out height, out pText)); + } + + public int GetInkBullets() + { + return (GetInkBullets(CInkAnalyzerClass)); + } + + public bool GetNextInkBulletsInfo(int BoxIndex, out int Left, out int Top, out int width, out int height) + { + return (GetNextInkBulletsInfo(CInkAnalyzerClass, BoxIndex, out Left, out Top, out width, out height)); + } + + + public int GetInkDrawingBoxes() + { + return (GetInkDrawingBoxes(CInkAnalyzerClass)); + } + + public bool GetNextInkInkDrawingHotSpots(int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText) + { + return (GetNextInkInkDrawingHotSpots(CInkAnalyzerClass, BoxIndex, out Left, out Top, out width, out height, out pText)); + } + +// public bool GetNextInkLineBoxInfo(int BoxIndex, out int Left, out int Top, out int width, out int height, out IntPtr pText) +// { +// return (GetNextInkLineBoxInfo(CInkAnalyzerClass, BoxIndex, out Left, out Top, out width, out height, out pText)); +// } +#endif + + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/PaperInkFile.cs b/PaperInkRecognizer/PaperInkRecognizer/PaperInkFile.cs new file mode 100644 index 0000000..d24b902 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/PaperInkFile.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + + +namespace PaperInkRecognizer +{ + public class PaperInkFile + { +#if DebugDLL +#if win32 + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern IntPtr InitPaperInkReader([MarshalAs(UnmanagedType.LPWStr)]string FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); + + [DllImport("..\\..\\..\\GeneralInkRecognizer\\Win32\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool EOFfound(IntPtr pFile); + +#else + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern IntPtr InitPaperInkReader([MarshalAs(UnmanagedType.LPWStr)]string FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); + + [DllImport("..\\..\\..\\..\\GeneralInkRecognizer\\x64\\Debug\\GeneralInkRecognizer.dll")] + public static extern bool EOFfound(IntPtr pFile); +#endif +#else + [DllImport("GeneralInkRecognizer.dll")] + public static extern IntPtr InitPaperInkReader([MarshalAs(UnmanagedType.LPWStr)]string FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold); + + [DllImport("GeneralInkRecognizer.dll")] + public static extern bool EOFfound(IntPtr pFile); +#endif + + public IntPtr cFileClass; + public PaperInkFile(string FileName, int RelativThreshold, int AbsoluteThreshold, int SlidingThreshold) + { + cFileClass = InitPaperInkReader(FileName, RelativThreshold, AbsoluteThreshold, SlidingThreshold); + } + public bool EOFfound() + { + return EOFfound(cFileClass); + } + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/PaperInkPage.cs b/PaperInkRecognizer/PaperInkRecognizer/PaperInkPage.cs new file mode 100644 index 0000000..73d7954 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/PaperInkPage.cs @@ -0,0 +1,358 @@ +/********************************************************************************** + * copyright : (C) 2012 by Herbert Ellebruch + * email : herbert@useful-tools.de + + ********************************************************************************** + * This file is part of PaperInkRecognizer. * + * * + * PaperInkRecognizer is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * PaperInkRecognizer is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with PaperInkRecognizer. If not, see . * + * * + *********************************************************************************/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.Runtime.InteropServices; +namespace PaperInkRecognizer +{ + public delegate int InkAnalyzerResultAvailable(); + public delegate bool InkInkDrawingInfo(int Left, int Top, int width, int height, IntPtr pText); + public delegate bool InkLineBoxInfo(int Left, int Top, int width, int height, IntPtr pText); + public delegate bool InkBulletInfo(int Left, int Top, int width, int height); + public delegate bool AnalyserHasFinished(int Left, int Top, int width, int height); + public delegate bool MathPanelReply(); + + public class PaperInkAnalysedPage + { + protected delegate void SetBoxTextCallback(); + + // used to prevent that the delegates are removed by the Garbage Collector + private InkAnalyzerResultAvailable InkAnalyzerResultAvailableFunctionPara; + private InkInkDrawingInfo InkInkDrawingInfoPara; + private InkLineBoxInfo InkLineBoxInfoPara; + private InkBulletInfo InkBulletInfoPara; + private AnalyserHasFinished AnalyserHasFinishedPara; + private MathPanelReply MathPanelReplyPara; + + + int Stroke_Y_Offset; // Offset of the first Stroke Line + LineLayout[] AnalysedPage; + + + RichTextBox richRecognizedTextBox; + PaperInkAnalyzer aInkAnalyzerPage; + + + public void PageToMathInputPanel() + { + aInkAnalyzerPage.TransferStrokesToMathInputPanel(); + } + + private void DisplayAnalysedText() + { + richRecognizedTextBox.Clear(); + + String TextToWrite = ""; + richRecognizedTextBox.BulletIndent = 30; + bool BulletOutputActive = false; + int LineIndex = 0; + foreach (LineLayout actualLine in AnalysedPage) + { + if (actualLine.Status == LineStatus.Empty) + { + // richTextBox1.AppendText("\n"); + if (LineIndex > 1) // dont add newlines to the start of the first 2 Lines + { + if (BulletOutputActive) + { + TextToWrite = TextToWrite + "\u2028"; + } + else + { + TextToWrite = TextToWrite + "\n"; + } + } + } + else + { + if (actualLine.Status == LineStatus.BulletStart) + { + if (LineIndex > 1) // dont add newlines to the start of the first 2 Lines + { + TextToWrite = TextToWrite + "\n"; + } + if (BulletOutputActive) + { +// TextToWrite = TextToWrite + "\n"; + } + else + { +// TextToWrite = TextToWrite + "\n"; + richRecognizedTextBox.SelectedText = TextToWrite; + TextToWrite = ""; + BulletOutputActive = true; + richRecognizedTextBox.SelectionBullet = true; + richRecognizedTextBox.SelectionIndent = 30; + } + } + else + { + if (actualLine.Status == LineStatus.Normal) + { + if (LineIndex > 1) // dont add newlines to the start of the first 2 Lines + { + TextToWrite = TextToWrite + "\n"; + } + if (BulletOutputActive) + { + // TextToWrite = TextToWrite + "\n"; + richRecognizedTextBox.SelectedText = TextToWrite; + TextToWrite = ""; + richRecognizedTextBox.SelectionBullet = false; + richRecognizedTextBox.SelectionIndent = 0; + BulletOutputActive = false; + } + else + { + // TextToWrite = TextToWrite + "\n"; + } + } + else + { + if (LineIndex > 1) // dont add newlines to the start of the first 2 Lines + { + if (actualLine.Status == LineStatus.BulletContinue) + { + TextToWrite = TextToWrite + "\u2028"; + } + else + { + TextToWrite = TextToWrite + "\n"; + } + } + } + } + + //TextLayout wir = (TextLayout)actualLine.LineContents[0]; + ArrayList LineStrings = actualLine.LineContents; + bool first = true; + foreach (TextLayout RecognizedString in LineStrings) + { + if (!first) + { + // richTextBox1.AppendText(" "); + TextToWrite = TextToWrite + (" "); + } + first = false; + String actualText = RecognizedString.LineString; + // richTextBox1.AppendText(actualText); + TextToWrite = TextToWrite + actualText; + } + } + LineIndex = LineIndex + 1; + } + richRecognizedTextBox.SelectedText = TextToWrite; + richRecognizedTextBox.Select(1, 0); + + } + public class LineSorter : IComparer + { + int IComparer.Compare(Object x, Object y) + { + return (((TextLayout)x).TextStart.X - ((TextLayout)y).TextStart.X); + } + } + + public int InkAnalyzerResultAvailable( ) + { + ClearLayout(); + Stroke_Y_Offset = 0; + + return (0); + } + + public bool InkInkDrawingInfo(int Left, int Top, int width, int height, IntPtr pText) + { // for future use, not implemented at the moment + return false; + } + + public bool InkLineBoxInfo(int Left, int Top, int width, int height, IntPtr pText) + { + // long NumberOfInkLineBoxes = aLayer.GetInkLineBoxes(); // Counts Number of Lines (Line Boxes) + string Text = Marshal.PtrToStringUni(pText); + + // Rectangle ActualLineDimension = new Rectangle(Left, Bottom, width, height); + int FoundLineNumber = ((Top + height) - Stroke_Y_Offset) / 450; // Top is the upper position of the Line Top Position is less than Bottom Position + + TextLayout actualText = new TextLayout(); + actualText.TextStart.X = Left; // TODO Change Point in Rectangle + actualText.TextStart.Y = Top + height; + actualText.LineString = Text; + + AnalysedPage[FoundLineNumber].LineContents.Add(actualText); + AnalysedPage[FoundLineNumber].Status = LineStatus.Normal; + return true; + } + + public bool InkBulletInfo(int Left, int Top, int width, int height) + { + // long NumberOfBulletBoxes = aLayer.GetInkBullets(); // Counts Number of Bullets (Bullet Boxes) + Rectangle ActualLineDimension = new Rectangle(Left, Top, width, height); + + int FoundLineNumber = ((Top + height) - Stroke_Y_Offset + 225) / 450; // Top is the upper position of the Line Top Possition is less than Bottom Position + if (AnalysedPage[FoundLineNumber].LineContents.Count == 0) + { + FoundLineNumber = FoundLineNumber + 1; + } + AnalysedPage[FoundLineNumber].Status = LineStatus.BulletStart; + AnalysedPage[FoundLineNumber].BulletPosition = ActualLineDimension; + return true; + } + + public bool AnalyserHasFinished(int Left, int Top, int width, int height) + { + + IComparer myLineSorter = new LineSorter(); + + bool BulletLines = false; + // int LineNumber = 1; + int BulletLineNumber = 0; + int Bullet_Y_Limit = 0; + //foreach (LineLayout actualLine in AnalysedPage) + for (int LineNumber = 0; LineNumber < AnalysedPage.Length; LineNumber++) + { + // LineLayout actualLine = AnalysedPage[LineNumber]; + if (AnalysedPage[LineNumber].Status != LineStatus.Empty) + { + /* Test for Sort Function + TextLayout TestSort = (TextLayout)AnalysedPage[LineNumber].LineContents[0]; + TestSort.TextStart.X = TestSort.TextStart.X + 2; + // TestSort.TextStart.Y = TestSort.TextStart.Y + 2; + AnalysedPage[LineNumber].LineContents.Add(TestSort); + */ + AnalysedPage[LineNumber].LineContents.Sort(myLineSorter); + if (AnalysedPage[LineNumber].Status == LineStatus.BulletStart) + { + BulletLines = true; + Bullet_Y_Limit = (AnalysedPage[LineNumber].BulletPosition.Left + AnalysedPage[LineNumber].BulletPosition.Right) / 2; + BulletLineNumber = LineNumber; + } + else + { + if (BulletLines) + { + if ((LineNumber - BulletLineNumber) > 8) + { + BulletLines = false; + } + if (((TextLayout)AnalysedPage[LineNumber].LineContents[0]).TextStart.X < Bullet_Y_Limit) + { + BulletLines = false; + } + else + { + AnalysedPage[LineNumber].Status = LineStatus.BulletContinue; + } + } + } + } + } + if (richRecognizedTextBox.InvokeRequired) + { + SetBoxTextCallback d = new SetBoxTextCallback(DisplayAnalysedText); + richRecognizedTextBox.Invoke(d, new object[] { }); + + } + else + { + DisplayAnalysedText(); + } + return false; + } + + public bool MathPanelReply() + { + return false; + } + + + public void AnalyzeInkPage() + { + aInkAnalyzerPage.AnalyzeInk(); + } + + public void AddStokesFromInkFile(PaperInkFile OpenedFile) { + // red, green, blue + // Color x = Color.FromArgb( 255, 0, 0); + aInkAnalyzerPage.AddStrokesFromFile(OpenedFile, Color.Black); + } + + public PaperInkAnalysedPage( IntPtr InkDrawingHandle, ref RichTextBox richRecognizedTextBox_in) + { + richRecognizedTextBox = richRecognizedTextBox_in; + + // all delegates must be passed via a Variable witch exists during the + // livetime of the class + // if not it is deleted by the garbage Collector + InkAnalyzerResultAvailableFunctionPara = this.InkAnalyzerResultAvailable; + InkInkDrawingInfoPara = this.InkInkDrawingInfo; + InkLineBoxInfoPara = this.InkLineBoxInfo; + InkBulletInfoPara = this.InkBulletInfo; + AnalyserHasFinishedPara = this.AnalyserHasFinished; + MathPanelReplyPara = this.MathPanelReply; + + aInkAnalyzerPage = new PaperInkAnalyzer(InkAnalyzerResultAvailableFunctionPara, // must be passed by a Class global Variable + InkInkDrawingInfoPara, // must be passed by a Class global Variable + InkLineBoxInfoPara, // must be passed by a Class global Variable + InkBulletInfoPara, // must be passed by a Class global Variable + AnalyserHasFinishedPara, // must be passed by a Class global Variable + MathPanelReplyPara, // must be passed by a Class global Variable + InkDrawingHandle); + + AnalysedPage = new LineLayout[80]; + ClearLayout(); + } + + public void ClearLayout() + { + for (int i = 0; i < AnalysedPage.Length; i++) + { + AnalysedPage[i].Status = LineStatus.Empty; + AnalysedPage[i].LineContents = new ArrayList(); + + } + Stroke_Y_Offset = 0; + } + + public void ClearPage() + { + aInkAnalyzerPage.DeleteAllStrokes(); + ClearLayout(); + } + + public void MoveInk(IntPtr HorinontalHandle, IntPtr VerticalHandle) { + bool Success = aInkAnalyzerPage.PositioningInkPanel(0, Stroke_Y_Offset, HorinontalHandle, VerticalHandle); + } + + public void CopyToClipboard() + { + bool Success = aInkAnalyzerPage.CopyToClipboard(); + } + } + +} \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj b/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj new file mode 100644 index 0000000..57cb3e7 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj @@ -0,0 +1,174 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF} + WinExe + Properties + PaperInkRecognizer + PaperInkRecognizer + v2.0 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + x86 + true + full + false + bin\Debug\ + TRACE;DEBUG;win32;DebugDLL + prompt + 4 + + + + + x86 + pdbonly + true + bin\Release\ + TRACE;win32 + prompt + 4 + + + true + bin\x64\Debug\ + TRACE;DEBUG;DebugDLL + full + x64 + bin\Debug\PaperInkRecognizer.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + bin\Release\PaperInkRecognizer.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + false + + + PaperInkRecognizer.Program + + + modify.ico + + + + + + + + + + + + Form + + + About.cs + + + + Form + + + GeneralLayout.cs + + + + + + + About.cs + + + GeneralLayout.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj.user b/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj.user new file mode 100644 index 0000000..364cd08 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/PaperInkRecognizer.csproj.user @@ -0,0 +1,20 @@ + + + + true + Project + + + true + + + publish\ + + + + + + en-US + false + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/Program.cs b/PaperInkRecognizer/PaperInkRecognizer/Program.cs new file mode 100644 index 0000000..38652de --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace PaperInkRecognizer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new GeneralLayout()); + } + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/Properties/AssemblyInfo.cs b/PaperInkRecognizer/PaperInkRecognizer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8fc4eda --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PaperInkRecognizer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PaperInkRecognizer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65bf0bcb-5bb4-4eb3-8087-fffb728fa711")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.Designer.cs b/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.Designer.cs new file mode 100644 index 0000000..5563020 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.261 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PaperInkRecognizer.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PaperInkRecognizer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.resx b/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.Designer.cs b/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.Designer.cs new file mode 100644 index 0000000..11595b3 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.261 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PaperInkRecognizer.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.settings b/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/PaperInkRecognizer/PaperInkRecognizer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/PaperInkRecognizer/PaperInkRecognizer/modify.ico b/PaperInkRecognizer/PaperInkRecognizer/modify.ico new file mode 100644 index 0000000..71dd48a Binary files /dev/null and b/PaperInkRecognizer/PaperInkRecognizer/modify.ico differ diff --git a/PaperInkRecognizer/Setup-32/Setup-32.vdproj b/PaperInkRecognizer/Setup-32/Setup-32.vdproj new file mode 100644 index 0000000..3675c6d --- /dev/null +++ b/PaperInkRecognizer/Setup-32/Setup-32.vdproj @@ -0,0 +1,828 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:Setup-32" +"LanguageId" = "3:0" +"CodePage" = "3:1252" +"UILanguageId" = "3:0" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_47B0EF7593D44BE69B327A3CB9954434" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_648A41A4553F4D8DA79E87F791B13D4C" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_944BDA888E9344DEA6BF6F206857BD4B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_ECEC7B7E3C7F4E05B1317657D333ACE8" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_ECEC7B7E3C7F4E05B1317657D333ACE8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_47B0EF7593D44BE69B327A3CB9954434" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\Setup-32.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\PaperInkRecognizer-32.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_4F6160059D4B4FC282A22BA5C7BEABB8" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v2.0" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" + } + } + } + "File" + { + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_0363EF4F06944F309C17C4FB22BE65BD" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_D595D7810A3648DE9B0EF98281D61E6E" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_DC2A145AB816404FB033DB196C50891C" + { + "DefaultLocation" = "8:[ProgramFilesFolder]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:0" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:PaperInkRecognizer" + "ProductCode" = "8:{DFBEF3DD-6C21-4E8E-BFCA-549BC859A87A}" + "PackageCode" = "8:{C7991CD4-002D-4857-8CB8-2D80E5C55DCB}" + "UpgradeCode" = "8:{4787AF91-7263-4E06-9733-8B3D5F86351B}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:FALSE" + "ProductVersion" = "8:1.0" + "Manufacturer" = "8:Ellebruch" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:Setup-32" + "Subject" = "8:" + "ARPCONTACT" = "8:Ellebruch Herbert" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_97F6CAD5816841078CD6A169D956BDD7" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_7D450F57F9CD4E7A99A9EE76A97478A1" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_0A7ADD0D3F80424D87EA869B2EDA08AD" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_606C7D6AC4D94FE5BD0CFC03E52F930A" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_8D8E1209C75449F7AC5BC6A4C8A36FBD" + { + "Name" = "8:PaperInkRecognizer" + "Arguments" = "8:" + "Description" = "8:" + "ShowCmd" = "3:1" + "IconIndex" = "3:32512" + "Transitive" = "11:FALSE" + "Target" = "8:_47B0EF7593D44BE69B327A3CB9954434" + "Folder" = "8:_D595D7810A3648DE9B0EF98281D61E6E" + "WorkingFolder" = "8:_DC2A145AB816404FB033DB196C50891C" + "Icon" = "8:_47B0EF7593D44BE69B327A3CB9954434" + "Feature" = "8:" + } + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2AD3B554F48544259B4953652A346E35" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_5F6CDF77D878417C92B266AD972FDB4D" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_80443B8D5BC2413991404A7CC6BE8A15" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_982E2B25CECC49EC9343F3A8E53E101C" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3C58E1BE08F84F4CB37796BE65D9C579" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DDA7AAFD568A4C0AA2E248D3BF39B460" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_7C4A9DD9DD2C4E65875C11B626222680" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_535E0FD3F9DB4C61AC5F5C173B115997" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_B45271AE459646939D8E326E3A2D006C" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_07058903A1344CDE9BDAFAD19358BF04" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_B5D97675C38245C38F1E18A4C59F30CD" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_86F9B6A0562746EAAB063F3767610B83" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_8C0C80429A6545E0A55595DF88838025" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C1C970DF14DD4B65B0988E1C4B17F408" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_B962AB7071084DA2B466518663038822" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_FAE506C73B4846B98BB6257CAC6E4733" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_DA333F65A82C46B6B85838B8133DEEED" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_F9723ADC23914F3BA979DDABF4AC963B" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + } + "MergeModule" + { + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_944BDA888E9344DEA6BF6F206857BD4B" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:..\\msm\\IACOM.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_ECEC7B7E3C7F4E05B1317657D333ACE8" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:..\\msm\\IACore.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_47B0EF7593D44BE69B327A3CB9954434" + { + "SourcePath" = "8:..\\PaperInkRecognizer\\obj\\x64\\Release\\PaperInkRecognizer.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_DC2A145AB816404FB033DB196C50891C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_648A41A4553F4D8DA79E87F791B13D4C" + { + "SourcePath" = "8:..\\GeneralInkRecognizer\\x64\\Release\\GeneralInkRecognizer.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_DC2A145AB816404FB033DB196C50891C" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{8C9289A5-F0E4-46E1-A110-477E60BBEA92}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff --git a/PaperInkRecognizer/Setup-64/Setup-64.vdproj b/PaperInkRecognizer/Setup-64/Setup-64.vdproj new file mode 100644 index 0000000..98d1563 --- /dev/null +++ b/PaperInkRecognizer/Setup-64/Setup-64.vdproj @@ -0,0 +1,862 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:Setup-64" +"LanguageId" = "3:0" +"CodePage" = "3:1252" +"UILanguageId" = "3:0" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_33BB89AA95024165BEB8F6514B23D938" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_4C22CB77BAF54D72B5AF9F6C0FCBC178" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_64599D050D32476EAD5369AE9377B8FC" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_69DFC19E4BFC4C84BF27B96138F7CA05" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_73753CD0AFC64ED8990F43B8B0469C62" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_4C22CB77BAF54D72B5AF9F6C0FCBC178" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_69DFC19E4BFC4C84BF27B96138F7CA05" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\Setup-64.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\PaperInkRecognizer-64.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } + } + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_14DFD1FA50FC4546A5E5F41C99973EC2" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v2.0" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" + } + } + } + "File" + { + } + "FileType" + { + } + "Folder" + { + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_460924514D0245F896F439EA6D009068" + { + "DefaultLocation" = "8:[ProgramFiles64Folder]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:TRUE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_586C0EA70A6841479BF2A4330C6CF44F" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_EF5FAB5B882C4A3BB21477B63A7D26AC" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:0" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:PaperInkRecognizer" + "ProductCode" = "8:{41F66A57-2653-44D4-8F82-A108D7281B9D}" + "PackageCode" = "8:{F4B73245-3997-483A-B008-00D3ADE272E3}" + "UpgradeCode" = "8:{690615A5-0256-48FE-B19C-CDE633B646A8}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:FALSE" + "ProductVersion" = "8:1.0" + "Manufacturer" = "8:Ellebruch" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:Setup-64" + "Subject" = "8:" + "ARPCONTACT" = "8:Ellebruch Herbert" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:1" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_256331786FF546779C504BD7CA4468A4" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_487601AABA074A2AAC954BCF9F1CA9C0" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_8951A7365BE246C88A6803EE3FC1C1CF" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_61C8E1A065E748868B8181FE2B19EB31" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_EFEA2489BE554A85BE576244E0939DDC" + { + "Name" = "8:PaperInkRecognizer" + "Arguments" = "8:" + "Description" = "8:" + "ShowCmd" = "3:1" + "IconIndex" = "3:32512" + "Transitive" = "11:FALSE" + "Target" = "8:_69DFC19E4BFC4C84BF27B96138F7CA05" + "Folder" = "8:_586C0EA70A6841479BF2A4330C6CF44F" + "WorkingFolder" = "8:_460924514D0245F896F439EA6D009068" + "Icon" = "8:_69DFC19E4BFC4C84BF27B96138F7CA05" + "Feature" = "8:" + } + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2D91BCD43CC849ECAD1A1F34804233E5" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_D32DAC4B072546B0B5696F25E7C58751" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_3B3C9B0D2A714E80A00183A4A8C3FB2B" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_73E0A3A2E3184CF493B55ED21EF78559" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1CFC775067594A7B90FE656CDDADA2C8" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_75254238E7BC4C5385A3BB6F5D9FB734" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_52BEC38C96A345BD9C84BC5CB356FB76" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_B583073DFF4F4F7594AD58B2A2620F45" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CF7B95D2960D46629FBCBF3FEF0208EE" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_821B0A8458E34B7D938F216BB71CBC1E" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_982BFAFE40E147388B72556A0E99CE07" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_B74E0E08FA684E33A9443F9337DB94DB" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C3AD5299F10543D4830992D279956E4F" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_859B5FFB7C2243EEB386B89A922D5E05" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_6FEF3A4A9FF4423295D6B3AF19089D1B" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_D6AD09371AED4E33A4E10AD28B31E404" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_286EBE4E2CDF4CA0BD3F8CD29897157F" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_D6B36B085B1D488E8AF9E30AB82A2451" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + } + "MergeModule" + { + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_4C22CB77BAF54D72B5AF9F6C0FCBC178" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:..\\msm\\IACore.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_73753CD0AFC64ED8990F43B8B0469C62" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:..\\msm\\IACOM.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_33BB89AA95024165BEB8F6514B23D938" + { + "SourcePath" = "8:..\\InkAnalyser32\\Release\\InkAnalyser32.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_460924514D0245F896F439EA6D009068" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:Release|Win32" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{39302845-AC68-4395-80C0-83B063854810}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_64599D050D32476EAD5369AE9377B8FC" + { + "SourcePath" = "8:..\\GeneralInkRecognizer\\x64\\Release\\GeneralInkRecognizer.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_460924514D0245F896F439EA6D009068" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{8C9289A5-F0E4-46E1-A110-477E60BBEA92}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_69DFC19E4BFC4C84BF27B96138F7CA05" + { + "SourcePath" = "8:..\\PaperInkRecognizer\\obj\\x64\\Release\\PaperInkRecognizer.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_460924514D0245F896F439EA6D009068" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{C1F3AFAB-79E8-4B9B-A57B-1BE219D2BBCF}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff --git a/PaperInkRecognizer/msm/IACOM.msm b/PaperInkRecognizer/msm/IACOM.msm new file mode 100644 index 0000000..483ed79 Binary files /dev/null and b/PaperInkRecognizer/msm/IACOM.msm differ diff --git a/PaperInkRecognizer/msm/IACore.msm b/PaperInkRecognizer/msm/IACore.msm new file mode 100644 index 0000000..d225cf2 Binary files /dev/null and b/PaperInkRecognizer/msm/IACore.msm differ diff --git a/examples/SKETCH_de.WPI b/examples/SKETCH_de.WPI new file mode 100644 index 0000000..7e86b83 Binary files /dev/null and b/examples/SKETCH_de.WPI differ diff --git a/examples/SKETCH_en.WPI b/examples/SKETCH_en.WPI new file mode 100644 index 0000000..06cf63c Binary files /dev/null and b/examples/SKETCH_en.WPI differ