// *********************************************************************** // Assembly : GeneratorCode // Author : 黄昕 // Created : 02-14-2019 // // Last Modified By : 黄昕 // Last Modified On : 02-19-2019 // *********************************************************************** // // Copyright © 2019 // // // *********************************************************************** using System.Runtime.InteropServices; namespace OIDModule.Generator { /// /// Enum OIDBeginBuildState /// internal enum OIDBeginBuildState { /// /// The e bb state ok /// eBBState_OK, /// /// The e bb state image file not exist /// eBBState_ImageFileNotExist, /// /// The e bb state fail to open image file /// eBBState_FailToOpenImageFile, /// /// The e bb state unknown /// eBBState_Unknown } /// /// Enum OIDPrintPointType /// internal enum OIDPrintPointType { /// /// The e oid print point type 2X2 /// eOID_PrintPointType_2x2, /// /// The e oid print point type 3X3 /// eOID_PrintPointType_3x3, /// /// The e oid print point type 4X4 /// eOID_PrintPointType_4x4 } /// /// Enum OIDPublishImageDPIType /// internal enum OIDPublishImageDPIType { /// /// The e oid publish image dpi 600 /// eOID_PublishImageDPI_600, /// /// The e oid publish image dpi 1200 /// eOID_PublishImageDPI_1200 } /// /// Enum OIDPublishImageType /// internal enum OIDPublishImageType { /// /// The e oid pit publish image /// eOID_PIT_Publish_Image, /// /// The e oid pit vertor image /// eOID_PIT_Vertor_Image, /// /// The e oid pit bg vertor image /// eOID_PIT_BG_Vertor_Image, /// /// The e oid pit publish bg image /// eOID_PIT_Publish_BG_Image } /// /// Enum OIDPublishObjectType /// internal enum OIDPublishObjectType { /// /// The e oid ot element code /// eOID_OT_ElementCode, /// /// The e oid ot position code /// eOID_OT_PositionCode } /// /// Class OIDPublishImageGenerator. /// internal class OIDPublishImageGenerator { /// /// Adds the object information. /// /// Index of the n page. /// Index of the UI object. /// The ar point x. /// The ar point y. /// The n points count. /// The n z order. /// Type of the n object. /// true if XXXX, false otherwise. 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); } /// /// Begins the build publish image. /// /// The sz bg image. /// if set to true [b export PDF image]. /// The n export PDF image dpi. /// System.Int32. public int BeginBuildPublishImage(char[] szBGImage, bool bExportPDFImage, int nExportPDFImageDPI) { return OID_PIG_BeginBuildPublishImage(szBGImage, bExportPDFImage, nExportPDFImageDPI); } /// /// Begins the build publish image by information. /// /// Width of the database cm. /// Height of the database cm. /// System.Int32. public int BeginBuildPublishImageByInfo(double dbCMWidth, double dbCMHeight) { return OID_PIG_BeginBuildPublishImageByInfo(dbCMWidth, dbCMHeight); } /// /// Builds the publish image. /// /// The sz output folder path. /// if set to true [b print idle code]. /// if set to true [b split big image]. /// if set to true [b merge splitted images]. /// Type of the n publish image dpi. /// Type of the n print point. /// Type of the n publish image. /// true if XXXX, false otherwise. 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); } /// /// Ends the build publish image. /// public void EndBuildPublishImage() { OID_PIG_EndBuildPublishImage(); } /// /// Initializes this instance. /// /// true if XXXX, false otherwise. public bool Initialize() { return OID_PIG_Initialize(); } /// /// Sets the publish pages. /// /// The ar page numbers. /// The n page count. /// true if XXXX, false otherwise. public bool SetPublishPages(int[] arPageNumbers, int nPageCount) { return OID_PIG_SetPublishPages(arPageNumbers, nPageCount); } /// /// Sets the start position. /// /// Index of the n page. /// The n x start. /// The n y start. /// true if XXXX, false otherwise. public bool SetStartPosition(int nPageIndex, int nXStart, int nYStart) { return OID_PIG_SetStartPosition(nPageIndex, nXStart, nYStart); } /// /// Uninitializes this instance. /// public void Uninitialize() { OID_PIG_Uninitialize(); } /// /// Oids the pig add object information. /// /// Index of the n page. /// Index of the UI object. /// The ar point x. /// The ar point y. /// The n points count. /// The n z order. /// Type of the n object. /// true if XXXX, false otherwise. [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); /// /// Oids the pig begin build publish image. /// /// The sz bg image. /// if set to true [b export PDF image]. /// The n export PDF image dpi. /// System.Int32. [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)] private static extern int OID_PIG_BeginBuildPublishImage(char[] szBGImage, bool bExportPDFImage, int nExportPDFImageDPI); /// /// Oids the pig begin build publish image by information. /// /// Width of the database cm. /// Height of the database cm. /// System.Int32. [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)] private static extern int OID_PIG_BeginBuildPublishImageByInfo(double dbCMWidth, double dbCMHeight); /// /// Oids the pig build publish image. /// /// The sz output folder path. /// if set to true [b print idle code]. /// if set to true [b split big image]. /// if set to true [b merge splitted images]. /// Type of the n publish image dpi. /// Type of the n print point. /// Type of the n publish image. /// true if XXXX, false otherwise. [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); /// /// Oids the pig end build publish image. /// [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall)] private static extern void OID_PIG_EndBuildPublishImage(); /// /// Oids the pig initialize. /// /// true if XXXX, false otherwise. [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall)] private static extern bool OID_PIG_Initialize(); /// /// Oids the pig set publish pages. /// /// The ar page numbers. /// The n page count. /// true if XXXX, false otherwise. [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall)] private static extern bool OID_PIG_SetPublishPages(int[] arPageNumbers, int nPageCount); /// /// Oids the pig set start position. /// /// Index of the n page. /// The n x start. /// The n y start. /// true if XXXX, false otherwise. [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall)] private static extern bool OID_PIG_SetStartPosition(int nPageIndex, int nXStart, int nYStart); /// /// Oids the pig uninitialize. /// [DllImport(@".\OIDPublishImageGenerator\OIDPublishImageGenerator.dll", CallingConvention = CallingConvention.StdCall)] private static extern void OID_PIG_Uninitialize(); } }