using System;
using System.Drawing;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
namespace FlyCapture2Managed
{
public class ManagedImage : IDisposable
{
public ManagedImage();
public ManagedImage(ManagedImage image);
public ManagedImage(byte* pData, uint dataSize);
public ManagedImage(uint rows, uint cols, PixelFormat format);
public ManagedImage(uint rows, uint cols, PixelFormat format, BayerTileFormat bayerFormat);
public ManagedImage(uint rows, uint cols, uint stride, byte* pData, uint dataSize, PixelFormat format);
public ManagedImage(uint rows, uint cols, uint stride, byte* pData, uint dataSize, PixelFormat format, BayerTileFormat bayerFormat);
public ManagedImage(uint rows, uint cols, uint stride, byte* pData, uint dataSize, uint receivedActualSize, PixelFormat format);
public ManagedImage(uint rows, uint cols, uint stride, byte* pData, uint dataSize, uint receivedActualSize, PixelFormat format, BayerTileFormat
}
那是原始代码。我正在努力完成这项工作
using System;
using System.Drawing;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
namespace FlyCapture2Managed2
{
public struct ManagedImage2 : IDisposable
{
public ManagedImage2();
public ManagedImage2(ManagedImage image);
public ManagedImage2(byte* pData, uint dataSize);
public ManagedImage2(uint rows, uint cols, PixelFormat format);
public ManagedImage2(uint rows, uint cols, PixelFormat format, BayerTileFormat bayerFormat);
public ManagedImage2(uint rows, uint cols, uint stride, byte* pData, uint dataSize, PixelFormat format);
public ManagedImage2(uint rows, uint cols, uint stride, byte* pData, uint dataSize, PixelFormat format, BayerTileFormat bayerFormat);
public ManagedImage2(uint rows, uint cols, uint stride, byte* pData, uint dataSize, uint receivedActualSize, PixelFormat format);
public ManagedImage2(uint rows, uint cols, uint stride, byte* pData, uint dataSize, uint receivedActualSize, PixelFormat format, BayerTileFormat
}
public class managed
{
[DllImport(@"S:\FlyCapture2SimpleGUI_CSharp\bin\x64\Debug\FlyCapture2Managedd_v100.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void managed();
}
我不断收到有关错误的错误
The type or namespace name 'PixelFormat' could not be found (are you missing a
using directive or an assembly reference?). The Pixelformat in this case is part of the name space "flycapture" and not System.Drawing.imaging namepspace
但是我不想使用引用,因为我更喜欢在我的工作中引用这段代码。
问候