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