轮胎外观检测添加思谋语义分割模型检测工具
C3204
2026-03-30 06c627ec032b3f3876fd7db8a3ff0ff1a6614fa2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
 
namespace MVAPI
{
 
    #region"enum"
 
    //brief Bayer颜色模式
    public enum MV_BAYER_MODE
    {
        BayerRG,    //< RG
        BayerBG,    //< BG
        BayerGR,    //< GR
        BayerGB,    //< GB
        BayerInvalid
    }
    public enum MV_PixelFormatEnums
    {
        PixelFormat_Mono8 = 0x01080001, //!<8Bit灰度
        PixelFormat_BayerBG8 = 0x0108000B,  //!<8Bit Bayer图,颜色模式为BGGR
        PixelFormat_BayerRG8 = 0x01080009,  //!<8Bit Bayer图,颜色模式为RGGB
        PixelFormat_BayerGB8 = 0x0108000A,  //!<8Bit Bayer图,颜色模式为GBRG
        PixelFormat_BayerGR8 = 0x01080008,  //!<8Bit Bayer图,颜色模式为GRBG
        PixelFormat_BayerGRW8 = 0x0108000C, //!<8Bit Bayer图,颜色模式为GRW8
        PixelFormat_Mono16 = 0x01100007,        //!<16Bit灰度
        PixelFormat_BayerGR16 = 0x0110002E, //!<16Bit Bayer图,颜色模式为GR
        PixelFormat_BayerRG16 = 0x0110002F, //!<16Bit Bayer图,颜色模式为RG
        PixelFormat_BayerGB16 = 0x01100030, //!<16Bit Bayer图,颜色模式为GB
        PixelFormat_BayerBG16 = 0x01100031    //!<16Bit Bayer图,颜色模式为BG  
    };
 
    public enum TriggerSourceEnums
    {
        TriggerSource_Software = 0,
        TriggerSource_Line1 = 2
    };
 
    public enum TriggerModeEnums
    {
        TriggerMode_Off,
        TriggerMode_On
    };
 
    public enum TriggerActivationEnums
    {
        TriggerActivation_RisingEdge,
        TriggerActivation_FallingEdge
    };
 
    public enum LineSourceEnums
    {
        LineSource_Off = 0,
        LineSource_ExposureActive = 5,
        LineSource_Timer1Active = 6,
        LineSource_UserOutput0 = 12
    };
 
    public enum UserSetSelectorEnums
    {
        UserSetSelector_Default,  //!<
        UserSetSelector_UserSet1,  //!<
        UserSetSelector_UserSet2   //!<
    };
 
    public enum SensorTapsEnums
    {
        SensorTaps_One,  //!<
        SensorTaps_Two,  //!<
        SensorTaps_Three,  //!<
        SensorTaps_Four,  //!<
    };
 
    public enum ImageFlipType
    {
        FlipHorizontal = 0,  //!< Flip Horizontally (Mirror)
        FlipVertical = 1, //!< Flip Vertically
        FlipBoth = 2 //!< Flip Vertically
    };
 
    enum ImageRotateType
    {
        Rotate90DegCw = 0,       //!< 顺时针旋转90度
        Rotate90DegCcw = 1       //!< 逆时针旋转90度
    };
    /// \brief Error return code enumeration. This is returned by all \c Jai_Factory.dll functions
    public enum MVSTATUS_CODES
    {
        MVST_SUCCESS = 0,      ///< OK      
        MVST_ERROR = -1001,  ///< Generic errorcode
        MVST_ERR_NOT_INITIALIZED = -1002,
        MVST_ERR_NOT_IMPLEMENTED = -1003,
        MVST_ERR_RESOURCE_IN_USE = -1004,
        MVST_ACCESS_DENIED = -1005,  ///< Access denied
        MVST_INVALID_HANDLE = -1006,  ///< Invalid handle
        MVST_INVALID_ID = -1007,  ///< Invalid ID
        MVST_NO_DATA = -1008,  ///< No data
        MVST_INVALID_PARAMETER = -1009,  ///< Invalid parameter
        MVST_FILE_IO = -1010,  ///< File IO error
        MVST_TIMEOUT = -1011,  ///< Timeout
        MVST_ERR_ABORT = -1012,  /* GenTL v1.1 */
        MVST_INVALID_BUFFER_SIZE = -1013,  ///< Invalid buffer size
        MVST_ERR_NOT_AVAILABLE = -1014,  /* GenTL v1.2 */
        MVST_INVALID_ADDRESS = -1015,  /* GenTL v1.3 */
    };
 
    public enum MVCameraRunEnums
    {
        MVCameraRun_ON,
        MVCameraRun_OFF
    };
 
    public enum MVShowWindowEnums
    {
        SW_SHOW = 5,
        SW_HIDE = 0
    };
 
    public enum AutoFunctionProfileEnums
    {
        AutoFunctionProfile_GainMinimum=0,  //!<Keep gain at minimum
        AutoFunctionProfile_ExposureMinimum=1   //!<Exposure Time at minimum
    };
 
    public enum ExposureAutoEnums
    {
        ExposureAuto_Off=0,  //!<Disables the Exposure Auto function.
        ExposureAuto_Once=1,  //!<Sets operation mode to 'once'.
        ExposureAuto_Continuous=2   //!<Sets operation mode to 'continuous'.
    };
 
    public enum GainAutoEnums
    {
        GainAuto_Off=0,  //!<Disables the Gain Auto function.
        GainAuto_Once=1,  //!<Sets operation mode to 'once'.
        GainAuto_Continuous=2   //!<Sets operation mode to 'continuous'.
    };
 
    public enum BalanceWhiteAutoEnums
    {
        BalanceWhiteAuto_Off=0,  //!<Disables the Balance White Auto function.
        BalanceWhiteAuto_Once=1,  //!<Sets operation mode to 'once'.
        BalanceWhiteAuto_Continuous=2   //!<Sets operation mode to 'continuous'.
    };
 
    public enum TestImageEnums
    {
        TestImageOff = 0,            //!< 测试图关闭,正常传图
        TestBlackImage = 1,
        TestWhiteImage = 2,
        TestGreyHorizontalRampImage = 3,
        TestGreyVerticalRampImage = 4,
        TestHorzontalLineMovingImage = 7,
        TestColorBarImage = 9,
        TestFrameCounterImage = 10,
        TestSensorSolidImage = 11, //!< 来自传感器的纯色或彩条图像
        TestSensorFadeImage = 12  //!< 来自传感器的渐变图像
    };
 
    #endregion
 
    #region"struct"
 
    [StructLayout(LayoutKind.Explicit)]
    public struct IMAGE_INFO
    {
        [FieldOffset(0)]
        public UInt64 nTimeStamp;   ///< 时间戳,采集到图像的时刻,精度为0.01us ;
        [FieldOffset(8)]
        public ushort nBlockId;        ///< 帧号,从开始采集开始计数
        [FieldOffset(16)]
        public IntPtr pImageBuffer;    ///< 图像指针,即指向(0,0)像素所在内存位置的指针,通过该指针可以访问整个图像;
        [FieldOffset(24)]
        public ulong nImageSizeAcq;    ///< 采集到的图像大小[字节];
        [FieldOffset(28)]
        public byte nMissingPackets;///< 传输过程中丢掉的包数量
        [FieldOffset(32)]
        public UInt64 nPixelType;        ///< Pixel Format Type
        [FieldOffset(40)]
        public UInt32 nSizeX;            ///< Image width
        [FieldOffset(44)]
        public UInt32 nSizeY;         ///< Image height
        [FieldOffset(48)]
        public UInt32 nOffsetX;        ///< Image offset x
        [FieldOffset(52)]
        public UInt32 nOffsetY;       ///< Image offset y                            
    }
 
    [StructLayout(LayoutKind.Sequential)]
    public struct MVCamInfo
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public byte[] mIpAddr;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
        public byte[] mEthernetAddr;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
        public string mMfgName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
        public string mModelName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
        public string mSerialNumber;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
        public string mUserDefinedName;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public byte[] m_IfIp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
        public byte[] m_IfMAC;
    }
 
    [StructLayout(LayoutKind.Sequential)]
    public struct MVStreamStatistic
    {
        public ulong m_nTotalBuf;
        public ulong m_nFailedBuf;
        public ulong m_nTotalPacket;
        public ulong m_nFailedPacket;
        public ulong m_nResendPacketReq;
        public ulong m_nResendPacket;
    }
 
    [StructLayout(LayoutKind.Sequential)]
    public struct RGBQUAD
    {
        public Byte R;
        public Byte G;
        public Byte B;
        public Byte res;
    };
    #endregion
 
    //回调函数声明
    //    [System.Runtime.InteropServices.UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
    internal delegate int MV_SNAPPROC(ref IMAGE_INFO pInfo, IntPtr UserVal);
 
    class MVGigE
    {
 
        public  Int64 INT64_MAX = 0x7fffffffffffffff;  /*maximum signed __int64 value */
        public  UInt64 INT64_MIN = 0x8000000000000000;  /*minimum signed __int64 value */
        public  UInt64 UINT64_MAX = 0xffffffffffffffff;  /*maximum unsigned __int64 value */
 
        public  Int32 INT32_MAX = 0x7fffffff;  /*maximum signed __int32 value */
        public  UInt32 INT32_MIN = 0x80000000;  /*minimum signed __int32 value */
        public  UInt32 UInt32_MAX = 0xffffffff;  /*maximum unsigned __int32 value */
 
        public  UInt16 UINT16_MAX = 0xffff;  /*maximum unsigned __int32 value */
 
        public  byte INT8_MAX = 0x7f; /*maximum signed __int8 value */
        public  byte INT8_MIN = 0x80;  /*minimum signed __int8 value */
        public  byte UINT8_MAX = 0xff;  /*maximum unsigned __int8 value */
 
 
        #region"function"
        /*!
         *  \brief 初始化函数库。在调用函数所有函数之前调用。
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVInitLib();
 
        /*!
         *  \brief 退出函数库。在程序退出前调用,以释放资源。
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVTerminateLib();
 
 
 
        /*! 
         *  \brief    查找连接到计算机上的相机
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVUpdateCameraList();
 
 
        /*! 
         *  \brief    获取连接到计算机上的相机的数量
         *  \param [out]    pNumCams    相机数量
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetNumOfCameras(out int pNumCams);
 
 
        /*! 
         *  \brief    得到第idx个相机的信息。
         *  \param [in]    idx idx从0开始,按照相机的IP地址排序,地址小的排在前面。
         *  \param [out]    pCamInfo  相机的信息 (IP,MAC,SN,型号...) 
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetCameraInfo(byte idx, out MVCamInfo pCamInfo);
 
 
        /*! 
         *  \brief    打开第idx个相机
         *  \param [in]    idx    idx从0开始,按照相机的IP地址排序,地址小的排在前面。
         *  \param [out]    hCam 如果成功,返回的相机句柄
         *  \retval MVST_INVALID_PARAMETER : idx取值不对
         *            MVST_ACCESS_DENIED        : 相机无法访问,可能正被别的软件控制
         *            MVST_ERROR                : 其他错误
         *            MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVOpenCamByIndex(byte idx, out IntPtr hCam);
 
        /*! 
         *  \brief    打开指定UserDefinedName的相机
         *  \param [in]    name UserDefinedName。
         *  \param [out]    hCam 如果成功,返回的相机句柄
         *  \retval 
         *            MVST_ACCESS_DENIED        : 相机无法访问,可能正被别的软件控制
         *            MVST_ERROR                : 其他错误
         *            MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVOpenCamByUserDefinedName(string name, out IntPtr hCam);
 
        /*! 
         *  \brief    打开指定IP的相机
         *  \param [in]    ip 相机的IP地址。
         *  \param [out] hCam 如果成功,返回的相机句柄。如果失败,为NULL。
         *  \retval 
         *            MVST_ACCESS_DENIED        : 相机无法访问,可能正被别的软件控制
         *            MVST_ERROR                : 其他错误
         *            MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVOpenCamByIP(string ip, out IntPtr hCam);
        
        /*! 
         *  \brief    关闭相机。断开和相机的连接。
         *  \param [in]    hCam 相机的句柄
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVCloseCam(IntPtr hCam);
 
        /*!
         * \brief    读取图像宽度
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    int * pWidth    图像宽度[像素]
         * \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetWidth(IntPtr hCam, out int pWidth);
 
 
        /*!
         * \brief    读取图像高度
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    int * pHeight    图像高度[像素]
         * \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetHeight(IntPtr hCam, out int pHeight);
 
 
        /*!
         * \brief    读取图像的像素格式
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    MV_PixelFormatEnums * pPixelFormat
         * \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPixelFormat(IntPtr hCam, out MV_PixelFormatEnums pPixelFormat);
 
 
        /*!
         *  \brief    读取传感器的通道数
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [out] SensorTapsEnums* pSensorTaps
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetSensorTaps(IntPtr hCam, out SensorTapsEnums pSensorTaps);
 
        /*!
         * \brief    读取当前增益值
         * \param [in]    HANDLE hCam    相机句柄
         * \param [out]    double * pGain
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGain(IntPtr hCam, out double pGain);
 
        /*!
         * \brief    读取增益可以设置的范围
         * \param [in]    HANDLE hCam    相机句柄
         * \param [out]    double * pGainMin    最小值
         * \param [out]    double * pGainMax    最大值
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGainRange(IntPtr hCam, out double pGainMin, out double pGainMax);
 
        /*!
         * \brief    设置增益
         * \param [in]    HANDLE hCam    相机句柄
         * \param [in]    double fGain    增益
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGain(IntPtr hCam, double fGain);
 
        /*!
         * \brief    当相机传感器为多通道时,设置某个通道的增益
         * \param [in]    HANDLE hCam        相机句柄
         * \param [in]    double fGain    增益
         * \param [in]    int nTap        通道。双通道[0,1],四通道[0,1,2,3]
         *  \retval MVC_ST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGainTaps(IntPtr hCam, double fGain, int nTap);
 
        /*!
         * \brief    当相机传感器为多通道时,读取某个通道的增益
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    out double pGain
         * \param [in]    int nTap        通道。双通道[0,1],四通道[0,1,2,3]
         *  \retval MVC_ST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGainTaps(int hCam, out double pGain, int nTap);
 
        /*!
         * \brief    当相机传感器为多通道时,读取某个通道的增益可设置的范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    double * pGainMin    增益最小值
         * \param [out]    double * pGainMax    增益最大值
         * \param [in]    int nTap        通道。双通道[0,1],四通道[0,1,2,3]
         *  \retval MVC_ST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGainRangeTaps(IntPtr hCam, out double pGainMin, out double pGainMax, int nTap);
 
        /*!
         * \brief    读取当前白平衡系数
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    double * pRed    红色平衡系数
         * \param [out]    double * pGreen 绿色平衡系数
         * \param [out]    double * pBlue    蓝色平衡系数
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetWhiteBalance(IntPtr hCam, out double pRed, out double pGreen, out double pBlue);
 
        /*!
         * \brief    读取白平衡设置的范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    double * pMin    系数最小值
         * \param [out]    double * pMax    系数最大值
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetWhiteBalanceRange(IntPtr hCam, out double pMin, out double pMax);
 
        /*!
         * \brief    设置白平衡系数
         * \param [in]    HANDLE hCam        相机句柄
         * \param [in]    double fRed        红色平衡系数
         * \param [in]    double fGreen    绿色平衡系数
         * \param [in]    double fBlue    蓝色平衡系数
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetWhiteBalance(IntPtr hCam, double fRed, double fGreen, double fBlue);
 
        /*!
         * \brief    读取是否通道自动平衡
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    out int pBalance    是否自动平衡
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGainBalance(IntPtr hCam, out int pBalance);
 
        /*!
         * \brief    设置是否自动通道平衡
         * \param [in]    HANDLE hCam        相机句柄
         * \param [in]    int nBalance    是否自动通道平衡
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGainBalance(IntPtr hCam, int nBalance);
 
        /*! 
         *  \brief    读取当前曝光时间
         *  \param [in]    hCam
         *  \param [in]    pExposuretime    单位us
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetExposureTime(IntPtr hCam, out double pExposuretime);
 
        /*!
         * \brief  读取曝光时间的设置范围  
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    double * pExpMin    最短曝光时间 单位为us
         * \param [out]    double * pExpMax    最长曝光时间 单位为us
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetExposureTimeRange(IntPtr hCam, out double pExpMin, out double pExpMax);
 
        /*!
         * \brief    设置曝光时间
         * \param [in]    HANDLE hCam        相机句柄
         * \param [in]    double nExp_us  曝光时间 单位为us
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetExposureTime(IntPtr hCam, double nExp_us);
 
        /*!
         * \brief    读取帧率可设置的范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    out double pFpsMin 最低帧率
         * \param [out]    out double pFpsMax 最高帧率    
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetFrameRateRange(IntPtr hCam, out double pFpsMin, out double pFpsMax);
 
        /*!
         * \brief    读取当前帧率   
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    double * fFPS    帧率 帧/秒
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetFrameRate(IntPtr hCam, out double fFPS);
 
        /*!
         * \brief    设置帧率
         * \param [in]    HANDLE hCam        相机句柄
         * \param [in]    double fps    帧率 帧/秒
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetFrameRate(IntPtr hCam, double fps);
 
        /*!
         *  \brief 开始采集图像
         *  \param [in]    hCam    相机句柄
         *  \param [in] StreamCB    回调函数指针
         *  \param [in]    nUserVal    用户数据,传递到回调函数的形参
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVStartGrab(IntPtr hCam, MV_SNAPPROC callbackFunc, IntPtr nUserVal);
        
        /*!
         *  \brief 采集一帧图像。
         *  \param [in]    hCam    相机句柄
         *  \param [out]    hImage    图像句柄。保存采集到的图像。
         *  \param [in]     nWaitMs    等待多长时间,单位ms
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSingleGrab(IntPtr hCam, IntPtr hImage, UInt64 nWaitMs);
 
        /*!
         *  \brief 停止采集图像
         *  \param [in]    hCam    相机句柄
         *  \retval  MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVStopGrab(IntPtr hCam);
 
 
        /*!
         * \brief    读取触发模式
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    TriggerModeEnums * pMode    触发模式  TriggerMode_Off,TriggerMode_On
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTriggerMode(IntPtr hCam, out TriggerModeEnums pMode);
 
        /*! 
         *  \brief    设置触发模式
         * \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    mode    触发模式
            TriggerMode_Off:相机工作在连续采集模式,
            TriggerMode_On:相机工作在触发模式,需要有外触发信号或软触发指令才拍摄
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTriggerMode(IntPtr hCam, TriggerModeEnums mode);
 
        /*!
         * \brief    读取触发源
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    TriggerSourceEnums * pSource    触发源,软触发或外触发
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTriggerSource(IntPtr hCam, out TriggerSourceEnums pSource);
        
        /*! 
         *  \brief    设置触发源
         * \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    TriggerSourceEnums    source 触发源
                        TriggerSource_Software:通过\c MVTriggerSoftware()函数触发。
                        TriggerSource_Line1:通过连接的触发线触发。
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTriggerSource(IntPtr hCam, TriggerSourceEnums source);
 
        /*!
         * \brief    读取触发极性
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    TriggerActivationEnums * pAct
                        TriggerActivation_RisingEdge: 上升沿触发
                        TriggerActivation_FallingEdge: 下降沿触发
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTriggerActivation(IntPtr hCam, out TriggerActivationEnums pAct);
        /*! 
         *  \brief    当使用触发线触发时,设置是上升沿触发还是下降沿触发
         *  \param [in]    hCam
         *  \param [in]    act 上升沿或下降沿
                        TriggerActivation_RisingEdge: 上升沿触发
                        TriggerActivation_FallingEdge: 下降沿触发
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTriggerActivation(IntPtr hCam, TriggerActivationEnums act);
 
        /*!
         * \brief    读取触发延时
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pDelay_us    触发延时,单位us
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTriggerDelay(IntPtr hCam, out UInt32 pDelay_us);
 
        /*!
         * \brief    读取触发延时范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pMin    触发延时最小值,单位us    
         * \param [out]    UInt32_t * pMax 触发延时最大值,单位us    
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTriggerDelayRange(IntPtr hCam, out UInt32 pMin, out UInt32 pMax);
        /*! 
         *  \brief    设置相机接到触发信号后延迟多少微秒后再开始曝光。
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    nDelay_us
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTriggerDelay(IntPtr hCam, UInt32 nDelay_us);
 
        /*! 
         *  \brief    发出软件触发指令
         *  \param [in]    HANDLE hCam        相机句柄
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVTriggerSoftware(IntPtr hCam);
 
        /*!
         * \brief    读取闪光同步信号源
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    LineSourceEnums * pSource    闪光同步信号源
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetStrobeSource(IntPtr hCam, out LineSourceEnums pSource);
        /*! 
         *  \brief    闪光同步信号源
         *  \param [in]    hCam
         *  \param [in]    source
                        LineSource_Off:关闭闪光同步
                        LineSource_ExposureActive:曝光的同时闪光
                        LineSource_Timer1Active:由定时器控制
                        LineSource_UserOutput0:由用户通过指令控制
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetStrobeSource(IntPtr hCam, LineSourceEnums source);
 
        /*!
         * \brief    读取闪光同步是否反转
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    BOOL * pInvert
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetStrobeInvert(IntPtr hCam, out bool pInvert);
 
        /*! 
         *  \brief    闪光同步是否反转,即闪光同步有效时输出高电平还是低电平。
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    bInvert
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetStrobeInvert(IntPtr hCam, bool bInvert);
 
        /*!
         * \brief    读取用户设置的闪光同步
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    BOOL * pSet
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetUserOutputValue0(IntPtr hCam, out bool pSet);
 
        /*! 
         *  \brief    当闪光同步源选为UserOutput时
                    主机可以通过MVSetUserOutputValue0来控制闪光同步输出高电平或低电平。
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    bSet 设置电平
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetUserOutputValue0(IntPtr hCam, bool bSet);
 
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetHeartbeatTimeout(IntPtr hCam, ulong nTimeOut);//unit ms
 
        /*!
         * \brief    读取网络数据包大小
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    int *pPacketSize 数据包大小
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPacketSize(IntPtr hCam, out uint pPacketSize);
        /*!
         * \brief    读取网络数据包范围
         * \param [in]    HANDLE hCam            相机句柄
         * \param [out]    UInt32 * pMin    网络数据包最小值    
         * \param [out]    UInt32 * pMax 网络数据包最大值    
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPacketSizeRange(IntPtr hCam, out uint pMin, out uint pMax);
 
        /*!
        *  \brief 获取最大合适传输包大小
        *  \param [in]    hCam    相机句柄
        * \param [out]pPacketSize    最大合适传输数据包
        *  \retval  MVST_SUCCESS            : 成功
        */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetOptimalPacketSize(IntPtr hCam, out uint pPacketSize);
 
        /*! 
         *  \brief    设置网络数据包的大小。
         *  \param [in]    hCam
         *  \param [in]    nPacketSize 网络数据包大小(单位:字节)。该大小应该小于网卡能够支持的最大巨型帧。
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetPacketSize(IntPtr hCam, uint nPacketSize);
 
        /*!
         * \brief    读取网络数据包间隔
         * \param [in]    HANDLE hCam                相机句柄
         * \param [out]    UInt32 *pDelay_us 数据包间隔时间,单位us
         *  \retval MVST_SUCCESS                : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPacketDelay(IntPtr hCam, out uint pDelay_us);
        /*!
         * \brief    读取网络数据包范围
         * \param [in]    HANDLE hCam            相机句柄
         * \param [out]    UInt32 * pMin    数据包间隔时间最小值,单位us    
         * \param [out]    UInt32 * pMax 数据包间隔时间最大值,单位us    
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPacketDelayRange(IntPtr hCam, out uint pMin, out uint pMax);
 
 
        /*! 
         *  \brief    设置网络数据包之间的时间间隔。如果网卡或电脑的性能欠佳,无法处理高速到达的数据包,
                    可以增加数据包之间的时间间隔以保证图像传输。但是增加该值将增加图像的时间延迟,并有可能影像到帧率。
         *  \param [in]    hCam
         *  \param [in]    nDelay_us 时间间隔(单位:微秒)
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetPacketDelay(IntPtr hCam, uint nDelay_us);
 
        /*!
         * \brief    读取定时器延时
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pDelay    定时器延时
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTimerDelay(IntPtr hCam, out UInt32 pDelay);
 
        /*!
         * \brief    读取定时器延时的范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pMin    定时器延时的最小值
         * \param [out]    UInt32_t * pMax 定时器延时的最大值
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTimerDelayRange(IntPtr hCam, out UInt32 pMin, out UInt32 pMax);
 
        /*! 
         *  \brief    当闪光同步源选为Timer1时,设置Timer1在接到触发信号后延迟多少us开始计时
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    UInt32_t nDelay 接到触发信号后延迟多少us开始计时
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTimerDelay(IntPtr hCam, UInt32 nDelay);
 
        /*!
         * \brief    读取定时器计时时长
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pDuration    定时器计时时长
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTimerDuration(IntPtr hCam, out UInt32 pDuration);
        /*!
         * \brief    读取定时器计时时长取值范围
         * \param [in]    HANDLE hCam        相机句柄
         * \param [out]    UInt32_t * pMin    定时器计时时长最小值
         * \param [out]    UInt32_t * pMax    定时器计时时长最大值
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetTimerDurationRange(IntPtr hCam, out UInt32 pMin, out UInt32 pMax);
 
        /*! 
        *  \brief    当闪光同步源选为Timer1时,设置Timer1在开始计时后,计时多长时间。
         *  \param [in]    HANDLE hCam
         *  \param [in]    UInt32_t nDuration 设置Timer1在开始计时后,计时多长时间(us)。即输出高/低电平的脉冲宽度。
         *  \retval MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTimerDuration(IntPtr hCam, UInt32 nDuration);
 
        //[DllImport("MVGigE.dll")] 
        // public static extern MVSTATUS_CODES  MVTRACE(byte format);
        /// <summary>
        /// Bayer格式图像数据到RGB格式图像数据转换 ( 转成RGB24位)
        /// </summary>
        /// <param name="hCam">该相机句柄</param>
        /// <param name="psrc">原始图像数据指针</param>
        /// <param name="pdst">转换后图像存储内存指针</param>
        /// <param name="dststep">转换步长</param>
        /// <param name="width">图像宽度</param>
        /// <param name="height">图像高度</param>
        /// <param name="pixelformat">像素格式</param>
        /// <returns>成功返回Success,否则返回错误信息</returns>
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVBayerToBGR(IntPtr hCam, IntPtr psrc, IntPtr pdst, uint dststep, uint width, uint height, MV_PixelFormatEnums pixelformat);
 
 
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVInfo2Image(IntPtr hCam, ref MVAPI.IMAGE_INFO pInfo, IntPtr pImage);
 
        /// <summary>
        /// <summary>
        /// 图像缩放
        /// </summary>
        /// <param name="hCam">该相机句柄</param>
        /// <param name="pSrc">原始图像指针</param>
        /// <param name="srcWidth">原始图像宽度</param>
        /// <param name="srcHeight">原始图像高度</param>
        /// <param name="pDst">缩放后存放图像内存指针</param>
        /// <param name="fFactorX">水平方向缩放因子</param>
        /// <param name="fFactorY">垂直方向缩放因子</param>
        /// <returns>成功返回Success,否则返回错误信息</returns>
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVZoomImageBGR(IntPtr hCam, IntPtr pSrc, int srcWidth, int srcHeight, out IntPtr pDst, double fFactorX, double fFactorY);
 
 
        /*!
         *  \brief    获取数据传输的统计信息
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pStatistic    统计信息
         *  \retval      JMVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetStreamStatistic(IntPtr hCam, MVStreamStatistic pStatistic);
 
 
 
        /*!
         *  \brief    读取并应用某组用户预设的参数
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    UserSetSelectorEnums userset
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVLoadUserSet(IntPtr hCam, UserSetSelectorEnums userset);
 
        /*!
         *  \brief    将当前相机的参数保存到用户设置中
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    UserSetSelectorEnums userset
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSaveUserSet(IntPtr hCam, UserSetSelectorEnums userset);
 
        /*!
         *  \brief    设置相机上电开机时默认读取并应用哪一组用户设置
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [in]    UserSetSelectorEnums userset
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetDefaultUserSet(IntPtr hCam, UserSetSelectorEnums userset);
 
        /*!
         *  \brief    读取相机上电开机时默认读取并应用哪一组用户设置
         *  \param [in]    HANDLE hCam        相机句柄
         *  \param [out]    UserSetSelectorEnums* pUserset    用户设置
         *  \retval      MVGIGE_API MVSTATUS_CODES __stdcall
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDefaultUserSet(IntPtr hCam, out UserSetSelectorEnums pUserset);
 
        /*!
         *  \brief 图像翻转
         *  \param [in]    hCam    相机句柄
         *  \param [in]     pSrcImage    源图像指针
         *  \param [out] pDstImage    结果图像指针。如果为NULL,则翻转的结果还在源图像内。
         *  \param [in]    flipType    翻转类型。FlipHorizontal:左右翻转,FlipVertical:上下翻转,FlipBoth:旋转180度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageFlip(IntPtr hCam, IntPtr pSrcImage, IntPtr pDstImage, ImageFlipType flipType);
        /*!
         *  \brief 图像旋转
         *  \param [in]    hCam    相机句柄
         *  \param [in]     pSrcImage    源图像指针
         *  \param [out] pDstImage    结果图像指针,不能为NULL。结果图像的宽度和高度应该和源图像的宽度和高度互换。
         *  \param [in]    roateType    旋转类型:Rotate90DegCw, Rotate90DegCcw
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageRotate(IntPtr hCam, IntPtr pSrcImage, IntPtr pDstImage, ImageRotateType roateType);
 
        /*!
        * \brief    获取相机版本信息
        * \param [in]    hCam        相机句柄
        * \param [out]    pData        版本信息
        * \param [in]    size        版本信息缓冲区大小
        * \retval MVST_SUCCESS            : 成功
        */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDeviceVersion(IntPtr hCam,StringBuilder pData, int size);
 
 
 
        /*!
         * \bief 获取相机固件版本信息
         * \param [in]    hCam        相机句柄
         * \param [out]    pData        固件版本信息
         * \param [in]    size        固件版本信息缓冲区大小
         * \retval MVST_SUCCESS            : 成功
        */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDeviceFirmwareVersion(IntPtr hCam, StringBuilder pData, int size);
 
 
 
        /*!
         *  \brief 读取图像宽度可设置的范围
         *  \param [in]    hCam        相机句柄
         *  \param [out]    pWidthMin    图像宽度可设置的最小值
         *  \param [out]    pWidthMax    图像宽度可设置的最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetWidthRange(IntPtr hCam, out int pWidthMin, out int pWidthMax);
 
 
 
        /*!
         *  \brief 读取图像宽度调整的步长
         *  \param [in]    hCam        相机句柄
         *  \param [out] pWidthInc    图像宽度的调整的步长,即图像的宽度 = 最小宽度 + 步长 x 整数
          *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetWidthInc(IntPtr hCam, out int pWidthInc);
 
 
 
        /*!
         *  \brief 设置图像的宽度
         *  \param [in]    hCam        相机句柄
         *  \param [in]    nWidth    图像宽度,应该在宽度可设置范围之内,并且 = 最小宽度 + 步长 x 整数
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetWidth(IntPtr hCam, int nWidth);
 
 
 
        /*!
         *  \brief 读取图像高度可设置的范围
         *  \param [in]    hCam        相机句柄
         *  \param [out]     pHeightMin    图像高度可设置的最小值
         *  \param [out]     pHeightMax    图像高度可设置的最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetHeightRange(IntPtr hCam, out int pHeightMin, out int pHeightMax);
 
 
 
        /*!
         *  \brief 设置图像的高度
         *  \param [in]    hCam        相机句柄
         *  \param [in]    nHeight    图像高度,应该在高度可设置范围之内
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetHeight(IntPtr hCam, int nHeight);
 
 
 
        /*!
         *  \brief 读取水平方向偏移量。图像宽度设置到小于最大宽度时,可以调整水平偏移量,设置采集窗口的水平起始位置。
         *  \param [in]    hCam
         *  \param [out]     pOffsetX    水平偏移量
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetOffsetX(IntPtr hCam, out int pOffsetX);
 
 
 
        /*!
         *  \brief 读取水平方向偏移量取值范围。
         *  \param [in]    hCam
         *  \param [out]     pOffsetXMin    水平偏移量最小值
         *  \param [out]     pOffsetXMax    水平偏移量最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetOffsetXRange(IntPtr hCam, out int pOffsetXMin, out int pOffsetXMax);
 
 
 
        /*!
         *  \brief 设置水平方向偏移量。图像宽度设置到小于最大宽度时,可以调整水平偏移量,设置采集窗口的水平起始位置。
         *  \param [in]    hCam
         *  \param [in]    nOffsetX 水平偏移量。应该在水平偏移量允许的范围之内。
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetOffsetX(IntPtr hCam, int nOffsetX);
 
 
 
        /*!
         *  \brief 读取垂直方向偏移量。图像宽度设置到小于最大宽度时,可以调整垂直偏移量,设置采集窗口的垂直起始位置。
         *  \param [in]    hCam
         *  \param [out]     pOffsetY    垂直偏移量
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetOffsetY(IntPtr hCam, out int pOffsetY);
 
 
 
        /*!
         *  \brief 读取垂直方向偏移量取值范围。
         *  \param [in]    hCam
         *  \param [out]     pOffsetYMin    垂直偏移量最小值
         *  \param [out]     pOffsetYMax    垂直偏移量最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetOffsetYRange(IntPtr hCam, out int pOffsetYMin, out int pOffsetYMax);
 
 
 
        /*!
         *  \brief 设置垂直方向偏移量。图像宽度设置到小于最大宽度时,可以调整垂直偏移量,设置采集窗口的垂直起始位置。
         *  \param [in]    hCam
         *  \param [in]    nOffsetY 垂直偏移量。应该在垂直偏移量允许的范围之内。
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetOffsetY(IntPtr hCam, int nOffsetY);
 
 
 
        /*!
         * \brief    设置图像的像素格式
         * \param [in]    hCam        相机句柄
         * \param [out]    PixelFormat
         * \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetPixelFormat(IntPtr hCam, MV_PixelFormatEnums PixelFormat);
 
 
 
        /*!
         *  \brief 如果有特殊需要,指定主机端接收图像的端口。一般应用无需设置。
         *  \param[]  hCam 相机句柄
         *  \param[]  nPort 主机端端口号
         *  \retval: MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetStreamHostPort(IntPtr hCam, int nPort);
 
 
 
        /*!
         *  \brief 将Bayer格式的16bit单通道图转换为BGR格式的16Bit三通道图
         *  \param [in]    hCam    相机句柄
         *  \param [in]    psrc    单通道图像的指针
         *  \param [out] pdst    三通道图像指针
         *  \param [in]    dststep    三通道图像一行图像的字节数。
         *  \param [in]    width    图像宽度
         *  \param [in]    height    图像高度
         *  \param [in]    pixelformat    像素格式,由MVGetPixelFormat取得
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVBayerToBGR16(IntPtr hCam, IntPtr psrc, IntPtr pdst, UInt32 dststep, UInt32 width, UInt32 height, MV_PixelFormatEnums pixelformat);
 
 
 
        /*!
         *  \brief 将Bayer格式的8bit单通道图转换为RGB格式的8Bit三通道图
         *  \param [in]    hCam    相机句柄
         *  \param [in]    psrc    单通道图像的指针
         *  \param [out] pdst    三通道图像指针
         *  \param [in]    dststep    三通道图像一行图像的字节数。通常为图像宽度*3,但是会为了4字节对齐会补几个字节。
         *  \param [in]    width    图像宽度
         *  \param [in]    height    图像高度
         *  \param [in]    pixelformat    像素格式,由MVGetPixelFormat取得
         *    \param [in] bMultiCores 是否使用CPU多核计算
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVBayerToRGB(IntPtr hCam, IntPtr psrc, IntPtr pdst, UInt32 dststep, UInt32 width, UInt32 height, MV_PixelFormatEnums pixelformat, bool bMultiCores);
 
 
 
        /*!
         *  \brief 将Bayer格式的16bit单通道图转换为RGB格式的16Bit三通道图
         *  \param [in]    hCam    相机句柄
         *  \param [in]    psrc    单通道图像的指针
         *  \param [out] pdst    三通道图像指针
         *  \param [in]    dststep    三通道图像一行图像的字节数。
         *  \param [in]    width    图像宽度
         *  \param [in]    height    图像高度
         *  \param [in]    pixelformat    像素格式,由MVGetPixelFormat取得
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVBayerToRGB16(IntPtr hCam, IntPtr psrc, IntPtr pdst, UInt32 dststep, UInt32 width, UInt32 height, MV_PixelFormatEnums pixelformat);
 
 
 
        /*!
         *  \brief 将Bayer格式的8bit单通道图转换为BGR格式的8Bit三通道图
         *  \param [in]    hCam    相机句柄
         *  \param [in]    pInfo    采集Callback函数中传来的图像信息指针
         *  \param [out] pImage    转换结果图像的指针
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageBayerToBGR(IntPtr hCam, ref IMAGE_INFO pInfo, ref MVImage pImage);
 
 
 
        /*!
         *  \brief 将Bayer格式的8bit单通道图转换为BGR格式的8Bit三通道图,同时调整图像的GAMMA,颜色和反差
         *  \param [in]    hCam    相机句柄
         *  \param [in]    pInfo    采集Callback函数中传来的图像信息指针
         *  \param [out]    pImage    转换结果图像的指针
         *  \param [in]     fGamma            Gamma校正值,1为不校正,<1时,将暗部提升。
         *  \param [in]     bColorCorrect        是否进行颜色校正,进行颜色校正后,图像会变得更鲜艳。
         *  \param [in]    nContrast            是否调整反差,范围为0-50,当该值大于0时,图像反差会更强。
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageBayerToBGREx(IntPtr hCam, ref IMAGE_INFO pInfo, ref MVImage pImage, double fGamma, bool bColorCorrect, int nContrast);
 
 
 
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageBayerToBGR(IntPtr hCam, ref IMAGE_INFO pInfo, IntPtr pImage);
 
 
 
        /*!
         *  \brief 将彩色BGR三通道24bit图像转换为灰度单通道8bit图像
         *  \param [in]    hCam    相机句柄
         *  \param [in]     psrc    彩色BGR三通道24bit图像指针
         *  \param [out]     pdst    灰度单通道8bit图像指针
         *  \param [in]     width    图像宽度
         *  \param [in]     height    图像高度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVBGRToGray(IntPtr hCam, IntPtr psrc, IntPtr pdst, UInt32 width, UInt32 height);
 
 
 
        /*!
         *  \brief 将彩色BGR三通道24bit图像转换为灰度单通道8bit图像
         *  \param [in]    hCam    相机句柄
         *  \param [in]     pSrcImage    彩色BGR三通道24bit图像指针
         *  \param [out]     pDstImage    灰度单通道8bit图像指针。宽度高度必须和源图相同
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageBGRToGray(IntPtr hCam, ref MVImage pSrcImage, ref MVImage pDstImage);
 
 
 
        /*!
         *  \brief    将彩色BGR三通道24bit图像转换为YUV图像 
         *  \param [in]    hCam    相机句柄
         *  \param [in]     pSrcImage    彩色BGR三通道24bit图像指针
         *  \param [out]     pDst    YUV图像指针 (YUV422)
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVImageBGRToYUV(IntPtr hCam, ref MVImage pSrcImage, IntPtr pDst);
 
 
 
        /*!
         *  \brief 将灰度单通道8bit图像转换为彩色BGR三通道24bit图像。转换后三个通道的值是相同的。
         *  \param [in]    hCam    相机句柄
         *  \param [in]     pSrc    灰度单通道8bit图像指针
         *  \param [out]     pDst    彩色BGR三通道24bit图像指针
         *  \param [in]     width    图像宽度
         *  \param [in]     height    图像高度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGrayToBGR(IntPtr hCam, IntPtr pSrc, IntPtr pDst, int width, int height);
 
 
 
        /*!
         *  \brief 获取当前自动曝光模式
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pExposureAuto    当前自动曝光模式
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetExposureAuto(IntPtr hCam, ref ExposureAutoEnums pExposureAuto);
 
 
 
        /*!
         *  \brief 设置自动曝光模式
         *  \param [in]    hCam    相机句柄
         *  \param [in]    ExposureAuto    自动曝光模式
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetExposureAuto(IntPtr hCam, ExposureAutoEnums ExposureAuto);
 
 
 
        /*!    
         *  \brief 获取当前自动增益模式
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pGainAuto    当前自动增益模式的
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGainAuto(IntPtr hCam, out GainAutoEnums pGainAuto);
 
 
 
        /*!
         *  \brief 设置当前自动增益模式
         *  \param [in]    hCam    相机句柄
         *  \param [in]    GainAuto    自动增益模式
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGainAuto(IntPtr hCam, GainAutoEnums GainAuto);
 
 
 
        /*!
         *  \brief 获取当前自动白平衡模式
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBalanceWhiteAuto    当前自动白平衡模式
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetBalanceWhiteAuto(IntPtr hCam, out BalanceWhiteAutoEnums pBalanceWhiteAuto);
 
 
 
        /*!
         *  \brief 设置自动白平衡模式
         *  \param [in]    hCam    相机句柄
         *  \param [in]    BalanceWhiteAuto    自动白平衡模式
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetBalanceWhiteAuto(IntPtr hCam, BalanceWhiteAutoEnums BalanceWhiteAuto);
 
 
 
        /*!
         *  \brief 获取自动调整增益时,增益调整范围的最小值
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoGainLowerLimit    增益调整范围的最小值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoGainLowerLimit(IntPtr hCam, out double pAutoGainLowerLimit);
 
 
 
        /*!
         *  \brief 设置自动调整增益时,增益调整范围的最小值
         *  \param [in]    hCam    相机句柄
         *  \param [in]     fAutoGainLowerLimit    增益调整范围的最小值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoGainLowerLimit(IntPtr hCam, double fAutoGainLowerLimit);
 
 
 
        /*!
         *  \brief 获取自动调整增益时,增益调整范围的最大值
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoGainUpperLimit    增益调整范围的最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoGainUpperLimit(IntPtr hCam, out double pAutoGainUpperLimit);
 
 
 
        /*!
         *  \brief 设置自动调整增益时,增益调整范围的最大值
         *  \param [in]    hCam    相机句柄
         *  \param [in]     fAutoGainUpperLimit    曝光时间调整范围的最小值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoGainUpperLimit(IntPtr hCam, double fAutoGainUpperLimit);
 
 
 
        /*!
         *  \brief 获取自动调整曝光时间时,曝光时间调整范围的最小值
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoExposureTimeLowerLimit    曝光时间调整范围的最小值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoExposureTimeLowerLimit(IntPtr hCam, out double pAutoExposureTimeLowerLimit);
 
 
 
        /*!
         *  \brief 设置自动调整曝光时间时,曝光时间调整范围的最小值
         *  \param [in]    hCam    相机句柄
         *  \param [in]     fAutoExposureTimeLowerLimit    曝光时间调整范围的最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoExposureTimeLowerLimit(IntPtr hCam, double fAutoExposureTimeLowerLimit);
 
 
 
        /*!
         *  \brief 获取自动调整曝光时间时,曝光时间调整范围的最大值
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoExposureTimeUpperLimit    曝光时间调整范围的最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoExposureTimeUpperLimit(IntPtr hCam, out double pAutoExposureTimeUpperLimit);
 
 
 
        /*!
         *  \brief 设置自动调整曝光时间时,曝光时间调整范围的最大值
         *  \param [in]    hCam    相机句柄
         *  \param [in]     fAutoExposureTimeUpperLimit
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoExposureTimeUpperLimit(IntPtr hCam, double fAutoExposureTimeUpperLimit);
 
 
 
        /*!
         *  \brief 获取自动调整亮度(曝光、增益)时,期望调整到的图像亮度
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoTargetValue    期望调整到的图像亮度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoTargetValue(IntPtr hCam, out int pAutoTargetValue);
 
 
 
        /*!
         *  \brief 设置自动调整亮度(曝光、增益)时,期望调整到的图像亮度
         *  \param [in]    hCam    相机句柄
         *  \param [in]    nAutoTargetValue    期望调整到的图像亮度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoTargetValue(IntPtr hCam, int nAutoTargetValue);
 
 
 
        /*!
         *  \brief 当自动增益和自动曝光时间都打开时,获取哪一个值优先调整
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pAutoFunctionProfile    增益优先或曝光时间优先
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoFunctionProfile(IntPtr hCam, out AutoFunctionProfileEnums pAutoFunctionProfile);
 
 
 
        /*!
         *  \brief 当自动增益和自动曝光时间都打开时,设置哪一个值优先调整
         *  \param [in]    hCam    相机句柄
         *  \param [in]    AutoFunctionProfile    增益优先或曝光时间优先
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoFunctionProfile(IntPtr hCam, AutoFunctionProfileEnums AutoFunctionProfile);
 
 
 
        /*!
         *  \brief    自动增益或自动曝光时,图像亮度与目标亮度差异的容差。
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pAutoThreshold    图像亮度与目标亮度差异的容差
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetAutoThreshold(IntPtr hCam, out int pAutoThreshold);
 
 
 
        /*!
         *  \brief 自动增益或自动曝光时,图像亮度与目标亮度差异的容差。
         *  \param [in]    hCam    相机句柄
         *  \param [in]    nAutoThreshold    图像亮度与目标亮度差异的容差
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetAutoThreshold(IntPtr hCam, int nAutoThreshold);
 
 
 
        /*!
         *  \brief 获取当前伽马值
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pGamma    当前伽马值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGamma(IntPtr hCam, out double pGamma);
 
 
 
        /*!
         *  \brief 获取伽马值可设置的范围
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pGammaMin    伽马最小值
         *  \param [out]     pGammaMax    伽马最大值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetGammaRange(IntPtr hCam, out double pGammaMin, out double pGammaMax);
 
 
 
        /*!
         *  \brief 设置伽马值
         *  \param [in]    hCam    相机句柄
         *  \param [in]     fGamma    伽马值
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGamma(IntPtr hCam, double fGamma);
 
 
 
        /*!
         *  \brief 设置查找表
         *  \param [in]    hCam    相机句柄
         *  \param [in]    pLUT    查找表数组,UInt32 pLUT[1024];
         *  \param [in]    nCnt    查找表数组单元个数,必须是1024
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetLUT(IntPtr hCam, IntPtr pLUT, int nCnt);
 
 
 
        /*!
         *  \brief 使用查找表
         *  \param [in]    hCam 相机句柄
         *  \param [in]     bEnable 是否允许
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetEnableLUT(IntPtr hCam, bool bEnable);
 
 
 
        /*!
         *  \brief 获取当前是否使用查找表状态
         *  \param [in]    hCam
         *  \param [out]    bEnable    当前是否使用查找表状态
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetEnableLUT(IntPtr hCam, out bool bEnable);
 
 
 
        /*!
         *  \brief 开始采集,并将采集到的图像显示到指定窗口
         *  \param [in]    hCam    相机句柄
         *  \param [in]    IntPtr    窗口句柄
         *  \param [in]    IntPtrMsg    消息句柄,如果不为NULL,当新的图像采集完毕,会发送消息(WM_USER+0x0200)到此窗口
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVStartGrabWindow(IntPtr hCam, IntPtr IntPtr, IntPtr IntPtrMsg);
 
 
 
        /*!
         *  \brief    停止采集到窗口
         *  \param [in]    hCam    相机句柄
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVStopGrabWindow(IntPtr hCam);
 
 
 
        /*!
         *  \brief    当采集到窗口时,暂停或继续采集。
         *  \param [in]    hCam    相机句柄
         *  \param [in]     bFreeze 
         *                TRUE:暂停采集,暂停后可以调用GetSampleGrab函数得到当前图像。
         *                FALSE:继续采集
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVFreezeGrabWindow(IntPtr hCam, bool bFreeze);
 
 
 
        /*!
         *  \brief 当采集到窗口时,设置图像显示的区域和比例。
         *  将图像中(xSrc,ySrc,wSrc,hSrc)指定的区域显示到窗口中指定区域(xDest,yDest,wDest,hDest)
         *  \param [in]    hCam    相机句柄
         *  \param [in]    xDest    指定显示窗口中目标矩形左上角的逻辑X坐标
         *  \param [in]    yDest    指定显示窗口中目标矩形左上角的逻辑Y坐标
         *  \param [in]    wDest    指定显示窗口中目标矩形的宽度
         *  \param [in]    hDest    指定显示窗口中目标矩形的高度
         *  \param [in]    xSrc    指定图像源位图左上角的逻辑X坐标
         *  \param [in]    ySrc    指定图像源位图左上角的逻辑Y坐标
         *  \param [in]    wSrc    指定图像源位图宽度
         *  \param [in]    hSrc    指定图像源位图高度
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetGrabWindow(IntPtr hCam, int xDest, int yDest, int wDest, int hDest, int xSrc, int ySrc, int wSrc, int hSrc);
 
 
 
        /*!
         *  \brief 当调用MVFreezeGrabWindow(TRUE)后,调用此函数可以获取当前图像。
         *  \param [in]    hCam    相机句柄
         *  \param [out]     image    图像
         *  \param [out]     nFrameID        图像的ID号
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetSampleGrab(IntPtr hCam, ref MVImage image, out int nFrameID, int msTimeout);
 
 
 
        /*!
         *  \brief 当调用MVFreezeGrabWindow(TRUE)后,调用此函数可以获取当前图像。
         *  \param [in]    hCam    相机句柄
         *  \param [out]     pImgBuf    图像指针
         *  \param [in]        szBuf   图像指针内存大小
         *  \param [out]     nFrameID        图像的ID号
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetSampleGrabBuf(IntPtr hCam, IntPtr pImgBuf, UInt32 szBuf, out int pFrameID, int msTimeout);
 
 
 
        /*!
         *  \brief 当计算机收到新的图像,而上一帧的Callback函数还没有执行完,SDK中会扔掉新的一帧图像。此函数可以获取扔掉的帧数。
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pDroppedFrames    扔掉的帧数
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDroppedFrame(IntPtr hCam, out UInt32 pDroppedFrames);
 
 
 
        /*!
         *  \brief 获取设备厂商名称
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBuf    用于保存名称的缓冲区,大于等于32字节
         *  \param [in,out]    szBuf 缓冲区大小
         *  \retval        MVST_SUCCESS            : 成功      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDeviceVendorName(IntPtr hCam, IntPtr pBuf, out int szBuf);
 
 
 
        /*!
         *  \brief 获取设备的型号
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBuf 用于保存型号的缓冲区,大于等于32字节
         *  \param [in,out]    szBuf 缓冲区大小
         *  \retval      MVST_SUCCESS            : 成功      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDeviceModelName(IntPtr hCam, IntPtr pBuf, out int szBuf);
 
 
 
        /*!
         *  \brief 获取设备的ID号,即序列号
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBuf    用于保存序列号的缓冲区,大于等于16字节
         *  \param [in,out]    szBuf    缓冲区大小
         *  \retval      MVST_SUCCESS            : 成功      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDeviceDeviceID(IntPtr hCam, IntPtr pBuf, out int szBuf);
 
 
 
        /*!
         *  \brief 相机是否正在采集图像
         *  \param [in]    hCam    相机句柄
         *  \retval      正在采集图像返回TRUE,否则返回FALSE
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVIsRunning(IntPtr hCam);
 
 
 
        /*!
         *  \brief 图像格式转换
         *  \param [in]    hCam    相机句柄
         *  \param [in]    pImageSrc    源图像指针
         *  \param [out]    pImageDst    目标图像指针
         *  \retval      
         *  \note 目前仅支持源图像和目标图像的宽高相同,从16Bit转为8Bit, 从48Bit转为24Bit
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVConvertImage(IntPtr hCam, ref MVImage pImageSrc, ref MVImage pImageDst);
 
 
 
        /*!
         *  \brief 直接从回调函数传回的图像信息中裁剪出图像的一部分,当相机不支持硬件ROI时,可以用此函数实现软件ROI。
         *  \param [in]    hCam    相机句柄
         *  \param [in]    pInfoSrc    源图像指针,一般是回调函数传回的图像信息指针
         *  \param [out]    pInfoDst    目标图像指针,nPixelType要和源图像的相同,需要提前分配好内存。并且宽度和高度要和roi的宽高相同。
         *  \param [in]    roi    感兴趣的区域,roi的left,right,top,bottom均须是2的整倍数
         *  \retval      
         *  \note 目前仅支持源图像和目标图像的宽高相同,从16Bit转为8Bit, 从48Bit转为24Bit
         */
        //[DllImport("MVGigE.dll")]
        //public static extern MVSTATUS_CODES MVCopyImageInfoROI(IntPtr hCam, ref IMAGE_INFO pInfoSrc, ref IMAGE_INFO pInfoDst, RECT roi);
 
 
 
        /*!
         *  \brief 自适应中值滤波,用于去除长时间曝光暗电流造成的图像中亮点,目前仅适用于8Bit黑白图像
         *  \param [in]    hCam 相机句柄
         *  \param [in/out]    pImage 图像
         *  \param [in]    th 阈值,和周围差异大于此阈值的被认为是噪点
         *  \retval      MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVFilterAdaptiveMedian(IntPtr hCam, ref MVImage pImage, int th);
 
 
 
        /*!
         *  \brief 调节饱和度
         *  \param [in]    hCam    相机句柄
         *  \param [in]    nSaturation    饱和度,范围-100到100, -100为黑白,0为原图,100为最鲜艳
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetSaturation(IntPtr hCam, int nSaturation);
 
 
 
        /*! 
         *  \brief    获取当前饱和度
         *  \param [in]    hCam    相机句柄
         *  \param [out]    nSaturation    饱和度指针
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetSaturation(IntPtr hCam, out int nSaturation);
 
 
 
        /*!
         *  \brief 颜色校正
         *  \param [in]    hCam    相机句柄
         *  \param [in]    nColorCorrect, 颜色校正模式,目前仅支持0和1,0为不校正,1为校正
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetColorCorrect(IntPtr hCam, int nColorCorrect);
 
 
 
        /*! 
         *  \brief 获取当前颜色校正模式
         *  \param [in]    hCam    相机句柄
         *  \param [out]    nColorCorrect    颜色校正模式指针
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetColorCorrect(IntPtr hCam, out int nColorCorrect);
 
 
 
        /*!
         *  \brief 注册用于接收消息的窗口句柄和消息值。当相机断开或重新连上时会发送消息到该窗口。
         *  \param [in]    hCam    相机句柄
         *  \param [in]    IntPtr    用于接收消息的窗口句柄
         *  \param [in]    nMsg    消息值
         *  \retval      
         *  \sa    MVEnableMessage
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVRegisterMessage(IntPtr hCam, IntPtr IntPtr, UInt32 nMsg);
 
 
 
        /*!
         *  \brief 是否允许发送某个消息
         *  \param [in]    hCam    相机句柄
         *  \param [in]    nMessageType    消息类型, MSG_ID_LOST,MSG_ID_RECONNECT
         *  \param [in]    bEnable    如果为TRUE,则发送该消息,为FALSE则不发送该消息
         *  \retval      
         *    \sa MVRegisterMessage
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVEnableMessage(IntPtr hCam, int nMessageType, bool bEnable);
 
 
 
        /*! 
         *  \brief 获取自定义名称
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBuf    相机名称缓冲区
         *  \param [in/out]    szBuf    相机名称缓冲区长度指针
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetUserDefinedName(IntPtr hCam, StringBuilder pBuf, out int szBuf);
 
 
 
        /*! 
         *  \brief 设置自定义名称
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBuf    相机名称缓冲区
         *  \param [in]    szBuf    相机名称缓冲区长度指针
         *  \retval 
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetUserDefinedName(IntPtr hCam, string pBuf, int szBuf);
 
 
 
        /*!
         *  \brief 以只读方式打开相机
         *  \param [in]    idx    idx从0开始,按照相机的IP地址排序,地址小的排在前面。
         *  \param [out]    hCam 如果成功,返回的相机句柄
         *  \retval MVST_INVALID_PARAMETER : idx取值不对
         *            MVST_ACCESS_DENIED        : 相机无法访问,可能正被别的软件控制
         *            MVST_ERROR                : 其他错误
         *            MVST_SUCCESS            : 成功
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVOpenCamByIndexReadOnly(byte idx, IntPtr hCam);
 
 
 
        /*!
         * \brief 搜索相机,包含不在同一网段的相机
         * \param [out] pDevCnt 相机数量指针
         * \retval
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVEnumerateAllDevices(out int pDevCnt);
 
 
 
        /*!
         * \brief 为相机设置ip地址
         * \param [in] pMacAddress  待设置ip相机的MAC地址
         * \param [in] pIpAddress    设置给相机的IP地址
         * \param [in] pSubnetMask    设置给相机的子网掩码
         * \param [in] pDefaultGateway 设置给相机的默认网关
         * \retval
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVForceIp( string pMacAddress, string pIpAddress, string pSubnetMask, string pDefaultGateway);
 
 
 
        /*!
         * \brief    获取MVEnumerateAllDevices搜索到的相机的信息
         * \param [in] idx    相机序号
         * \param [out] pCamInfo    相机信息
         * \retval
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetDevInfo(byte idx, out MVCamInfo pCamInfo);
 
 
 
        /*!
         * \brief 设置静态IP地址
         * \param [in] hCam
         * \param [in] pIpAddress    192.168.0.9
         * \param [in] pSubnetMask    255.255.255.0
         * \param [in] pDefaultGateway    0.0.0.0
         * \retval
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetPersistentIpAddress(IntPtr hCam,  string pIpAddress,  string pSubnetMask,  string pDefaultGateway);
 
 
 
        /*!
         * \brief 获取相机的静态IP设置
         * \param [in] hCam
         * \param [out] pIpAddress
         * \param [out] pIpAddressLen    pIpAddress缓冲区长度
         * \param [out] pSubnetMask
         * \param [out] pSubnetMaskLen    pSubnetMask缓冲区长度
         * \param [out] pDefaultGateway
         * \param [out] pDefaultGatewayLen    pDefaultGateway缓冲区长度
         * \retval
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetPersistentIpAddress(IntPtr hCam, string pIpAddress, out int pIpAddressLen, string pSubnetMask, out int pSubnetMaskLen, string pDefaultGateway, out int pDefaultGatewayLen);
 
 
        /*!
         *  \brief 
         *  \param [in]    hCam        相机句柄
         *  \param [in]    fBlackLevel    偏置
         *  \param [in]    nTap        通道
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetBlackLevelTaps(IntPtr hCam, double fBlackLevel, int nTap);
 
 
 
        /*!
         *  \brief 
         *  \param [in]    hCam        相机句柄
         *  \param [out]    pBlackLevel    偏置
         *  \param [in]    nTap        通道
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetBlackLevelTaps(IntPtr hCam, out double pBlackLevel, int nTap);
 
 
 
        /*!
         *  \brief 设置偏置
         *  \param [in]    hCam    相机句柄
         *  \param [in]    fBlackLevel    偏置
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetBlackLevel(IntPtr hCam, double fBlackLevel);
 
 
 
        /*!
         *  \brief 读取偏置
         *  \param [in]    hCam    相机句柄
         *  \param [out]    pBlackLevel    偏置
         *  \retval      
         */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVGetBlackLevel(IntPtr hCam, out double pBlackLevel);
 
 
 
        /*!
        * \brief 设置测试图
        * \param [in] hCam 相机句柄
        * \param [in] testImage 测试图
        * \sa TestImageEnums 
        *  TestImage_Off        : 关闭测试图
        *  TestImage_GreyRamp    : 灰度图
        *
        */
        [DllImport("MVGigE.dll")]
        public static extern MVSTATUS_CODES MVSetTestImage(IntPtr hCam, TestImageEnums testImage);
 
 
 
        [DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)]
        public static extern void CopyMemory(IntPtr dest, IntPtr src, uint count);
 
        #endregion
    }
    class MVImage
    {
        #region"function"
        [DllImport("MVGigE.dll")]
        public static extern IntPtr MVImageCreate(int nWidth, int nHeight, int nBPP);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageIsNull(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern int MVImageGetWidth(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern int MVImageGetHeight(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern IntPtr MVImageGetBits(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern int MVImageGetPitch(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern int MVImageGetBPP(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDraw(IntPtr hImage, IntPtr hDestDC, int xDest, int yDest);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDrawEx(IntPtr hImage, IntPtr hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDrawIntPtr(IntPtr hImage, IntPtr IntPtr, int xDest, int yDest);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDrawIntPtrEx(IntPtr hImage, IntPtr IntPtr, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDrawHwnd(IntPtr hImage, IntPtr hWnd, int xDest, int yDest);
        [DllImport("MVGigE.dll")]
        public static extern bool MVImageDrawHwndEx(IntPtr hImage, IntPtr hWnd, int xDest, int yDest, int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight);
        [DllImport("MVGigE.dll")]
        public static extern IntPtr MVImageGetDC(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern IntPtr MVImageReleaseDC(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern void MVImageSave(IntPtr hImage, string strFileName);
        [DllImport("MVGigE.dll")]
        public static extern void MVImageDestroy(IntPtr hImage);
        [DllImport("MVGigE.dll")]
        public static extern void MVImageRelease(IntPtr hImage);
        #endregion
    }
    class MVCamProptySheet
    {
        public const UInt16 PAGE_NONE            = 0x0000;
        public const UInt16 PAGE_ALL            = 0xffff;
        public const UInt16 PAGE_ACQUISITION    = 0x0001;
        public const UInt16 PAGE_WHITE_BALANCE    = 0x0002;
        public const UInt16 PAGE_TRANS_LAYER    = 0x0004;
        public const UInt16 PAGE_TRIGGER        = 0x0008;
        public const UInt16 PAGE_CAMERA_INFO    = 0x0010;
        public const UInt16 PAGE_IMAGE_FORMAT    = 0x0020;
        public const UInt16 PAGE_AUTOGE_CONTROL    = 0x0040;
        public const UInt16 PAGE_USERSET        = 0x0080;
        #region"function"
        /*! 
         *  \brief 创建相机属性页
         *  \param [out] phProptySheet    返回相机属性页句柄
         *  \param [in] hCam    相机句柄
         *  \param [in] pParentWnd    父窗口句柄
         *  \param [in] lpszText    相机属性页标题栏文字
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetCreateEx(out IntPtr phProPerty, IntPtr hCam, IntPtr pParentWnd, string lpszText, UInt16 nPageDisplay);
        /*! 
         *  \brief 销毁相机属性页
         *  \param [in] hProptySheet    相机属性页句柄
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetDestroy(IntPtr hProPerty);
        /*! 
         *  \brief 设置相机属性页标题栏文字
         *  \param [in] hProptySheet    相机属性页句柄
         *  \param [in] lpszText    相机属性页标题栏文字
 
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetSetTitle(IntPtr hProPerty, string lpszText);
        /*! 
         *  \brief 设置相机属性页对应的相机。
         *  \param [in] hProptySheet    相机属性页句柄
         *  \param [in] hCam    相机句柄
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetSetCamera(IntPtr hProPerty, IntPtr hCam);
        /*! 
         *  \brief 获取相机属性页当前对应的相机。
         *  \param [in] hProptySheet    相机属性页句柄
         *  \param [out] phCam    相机句柄
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetGetCamera(IntPtr hProPerty, out IntPtr hCam);
        /*! 
         *  \brief 设置相机现在是否正工作在采集模式。
         *  \param [in] hProptySheet    相机属性页句柄
         *  \param [in] Run    如果相机正工作在采集模式下,设置为TRUE,否则设置为FALSE
         *  \note 如果正工作在采集模式,属性页中将禁用一些采集状态下不允许改变的相机属性,如图像大小等。
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetCameraRun(IntPtr hProPerty, MVCameraRunEnums Run);
        /*! 
         *  \brief    以非模式框方式显示或关闭相机属性页
         *  \param [in] hProptySheet    相机属性页句柄
         *  \param [in] nCmdShow    SW_SHOW:显示, SW_HIDE:关闭
         *  \retval 
         */
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetShow(IntPtr hProPerty, MVShowWindowEnums nCmdShow);
        #endregion
 
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetInsertPage(IntPtr hProptySheet, UInt16 nPageInsert);
 
        [DllImport("MVCamProptySheet.dll")]
        public static extern MVSTATUS_CODES MVCamProptySheetDeletePage(IntPtr hProptySheet, UInt16 nPageDelete);
    }
    class MVSequenceDlg
    {
        #region"function"
        /*! 
         *  \brief 创建序列帧计时器对话框
         *  \param [out] phSeqDlg    返回序列帧计时器对话框句柄
         *  \param [in] pParentWnd    父窗口句柄
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVSequenceDlgCreateEx(out IntPtr phSeqDlg, IntPtr pParentWnd);
        /*! 
         *  \brief 销毁序列帧计时器对话框
         *  \param [in] hSeqDlg    序列帧计时器对话框句柄
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVSequenceDlgDestroy(IntPtr hSeqDlg);
        /*! 
         *  \brief 设置相机现在是否正工作在采集模式。
         *  \param [in] hSeqDlg    序列帧计时器对话框句柄
         *  \param [in] bRun    如果相机正工作在采集模式下,设置为TRUE,否则设置为FALSE
         *  \note 如果正工作在采集模式,属性页中将禁用一些采集状态下不允许改变的相机属性,如图像大小等。
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern void MVSequenceDlgCamRun(IntPtr hSeqDlg, bool bRun);
        /*! 
         *  \brief    以非模式框方式显示或关闭序列帧计时器对话框
         *  \param [in] hSeqDlg    序列帧计时器对话框句柄
         *  \param [in] nCmdShow    SW_SHOW:显示, SW_HIDE:关闭
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVSequenceDlgShow(IntPtr hSeqDlg, MVShowWindowEnums nCmdShow);
        /*! 
         *  \brief    获得即将进入队列的文件名,及当前图片是否需要保存
         *  \param [in] hSeqDlg    序列帧计时器对话框句柄
         *  \param [out] fname    返回文件名
         *  \param [in] szBuf    文件名长度
         *  \retval 0:保存   -1:不保存  -2:获取文件名出错
         */
        [DllImport("MVTickDlg")]
        public static extern int MVSequenceDlgGetFileName(IntPtr hSeqDlg, StringBuilder fname, Int32 szBuf);
        #endregion
    }
    class MVRecordDlg
    {
        #region"function"
        /*! 
         *  \brief 创建录像计时器对话框
         *  \param [out] phRecDlg    返回录像计时器对话框句柄
         *  \param [in] hCam    相机句柄
         *  \param [in] pParentWnd    父窗口句柄
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVRecordDlgCreateEx(out IntPtr phRecDlg, IntPtr hCam, IntPtr pParentWnd);
        /*! 
         *  \brief 销毁录像计时器对话框
         *  \param [in] hRecDlg    录像计时器对话框句柄
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVRecordDlgDestroy(IntPtr hRecDlg);
        /*! 
         *  \brief 设置相机现在是否正工作在采集模式。
         *  \param [in] hRecDlg    录像计时器对话框句柄
         *  \param [in] bRun    如果相机正工作在采集模式下,设置为TRUE,否则设置为FALSE
         *  \note 如果正工作在采集模式,属性页中将禁用一些采集状态下不允许改变的相机属性,如图像大小等。
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern void MVRecordDlgCamRun(IntPtr hRecDlg, bool bRun);
        /*! 
         *  \brief    以非模式框方式显示或关闭录像计时器对话框
         *  \param [in] hRecDlg    录像计时器对话框句柄
         *  \param [in] nCmdShow    SW_SHOW:显示, SW_HIDE:关闭
         *  \retval 
         */
        [DllImport("MVTickDlg")]
        public static extern bool MVRecordDlgShow(IntPtr hSeqDlg, MVShowWindowEnums nCmdShow);
        /*! 
         *  \brief    向录像中插入帧
         *  \param [in] hRecDlg    录像计时器对话框句柄
         *  \param [in] pImageBuffer 图像指针
         *  \param [in] nWidth 图像宽度
         *  \param [in] nHeight 图像高度
         *  \param [in] nBpp 单个像素点位数
         *  \param [in] nBlockId 帧号,从开始采集开始计数,计时器根据帧号确定该帧是否插入录像
         *  \retval 0:插入成功  -1:不需插入 -2:插入失败 -3:文件指针为空 1:插入成,并且计时停止
         */
        [DllImport("MVTickDlg")]
        public static extern int MVRecordDlgRecord(IntPtr hRecDlg, IntPtr hIamge, ushort nBlockId);
        #endregion
    }
}