namespace OIDModule.Generator { using System; using System.Runtime.InteropServices; internal enum OIDBeginBuildState { eBBState_OK, eBBState_ImageFileNotExist, eBBState_FailToOpenImageFile, eBBState_Unknown } internal enum OIDPrintPointType { eOID_PrintPointType_2x2, eOID_PrintPointType_3x3, eOID_PrintPointType_4x4 } internal enum OIDPublishImageDPIType { eOID_PublishImageDPI_600, eOID_PublishImageDPI_1200 } internal enum OIDPublishImageType { eOID_PIT_Publish_Image, eOID_PIT_Vertor_Image, eOID_PIT_BG_Vertor_Image, eOID_PIT_Publish_BG_Image } internal enum OIDPublishObjectType { eOID_OT_ElementCode, eOID_OT_PositionCode } internal class OIDPublishImageGenerator { public bool AddObjectInfo(int nPageIndex, ulong uiObjectIndex, uint[] arPointX, uint[] arPointY, int nPointsCount, int nZOrder, int nObjectType) { return OID_PIG_AddObjectInfo(nPageIndex, uiObjectIndex, arPointX, arPointY, nPointsCount, nZOrder, nObjectType); } public int BeginBuildPublishImage(char[] szBGImage, bool bExportPDFImage, int nExportPDFImageDPI) { return OID_PIG_BeginBuildPublishImage(szBGImage, bExportPDFImage, nExportPDFImageDPI); } public int BeginBuildPublishImageByInfo(double dbCMWidth, double dbCMHeight) { return OID_PIG_BeginBuildPublishImageByInfo(dbCMWidth, dbCMHeight); } public bool BuildPublishImage(char[] szOutputFolderPath, bool bPrintIdleCode, bool bSplitBigImage, bool bMergeSplittedImages, int nPublishImageDPIType, int nPrintPointType, int nPublishImageType) { return OID_PIG_BuildPublishImage(szOutputFolderPath, bPrintIdleCode, bSplitBigImage, bMergeSplittedImages, nPublishImageDPIType, nPrintPointType, nPublishImageType); } public void EndBuildPublishImage() { OID_PIG_EndBuildPublishImage(); } public bool Initialize() { return OID_PIG_Initialize(); } [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern bool OID_PIG_AddObjectInfo(int nPageIndex, ulong uiObjectIndex, uint[] arPointX, uint[] arPointY, int nPointsCount, int nZOrder, int nObjectType); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall, CharSet=CharSet.Unicode)] private static extern int OID_PIG_BeginBuildPublishImage(char[] szBGImage, bool bExportPDFImage, int nExportPDFImageDPI); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall, CharSet=CharSet.Unicode)] private static extern int OID_PIG_BeginBuildPublishImageByInfo(double dbCMWidth, double dbCMHeight); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall, CharSet=CharSet.Unicode)] private static extern bool OID_PIG_BuildPublishImage(char[] szOutputFolderPath, bool bPrintIdleCode, bool bSplitBigImage, bool bMergeSplittedImages, int nPublishImageDPIType, int nPrintPointType, int nPublishImageType); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern void OID_PIG_EndBuildPublishImage(); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern bool OID_PIG_Initialize(); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern bool OID_PIG_SetPublishPages(int[] arPageNumbers, int nPageCount); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern bool OID_PIG_SetStartPosition(int nPageIndex, int nXStart, int nYStart); [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention=CallingConvention.StdCall)] private static extern void OID_PIG_Uninitialize(); public bool SetPublishPages(int[] arPageNumbers, int nPageCount) { return OID_PIG_SetPublishPages(arPageNumbers, nPageCount); } public bool SetStartPosition(int nPageIndex, int nXStart, int nYStart) { return OID_PIG_SetStartPosition(nPageIndex, nXStart, nYStart); } public void Uninitialize() { OID_PIG_Uninitialize(); } } }