Help with importing DLL
-
Hi Im having trouble with a imported function called ICCompress. Im not sure if I have transled the function properly can someone help me? Native
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;DWORD ICCompress(
HIC hic,
DWORD dwFlags,
LPBITMAPINFOHEADER lpbiOutput,
LPVOID lpData,
LPBITMAPINFOHEADER lpbiInput,
LPVOID lpBits,
LPDWORD lpckid,
LPDWORD lpdwFlags,
LONG lFrameNum,
DWORD dwFrameSize,
DWORD dwQuality,
LPBITMAPINFOHEADER lpbiPrev,
LPVOID lpPrev
);C# code
\[StructLayoutAttribute(LayoutKind.Sequential)\] public struct BITMAPINFOHEADER { public uint biSize; public int biWidth; public int biHeight; public ushort biPlanes; public ushort biBitCount; public uint biCompression; public uint biSizeImage; public int biXPelsPerMeter; public int biYPelsPerMeter; public uint biClrUsed; public uint biClrImportant; } \[DllImport("MSVFW32.dll")\] public static extern int ICCompress( IntPtr hic, UInt32 dwFlags, // flags ref BITMAPINFOHEADER lpbiOutput, // output format IntPtr lpData, // output data ref BITMAPINFOHEADER lpbiInput, // format of frame to compress IntPtr lpBits, // frame data to compress out UInt32 lpckid, // ckid for data in AVI file out UInt32 lpdwFlags, // flags in the AVI index. int lFrameNum, // frame number of seq. UInt32 dwFrameSize, // reqested size in bytes. (if non zero) UInt32 dwQuality, // quality within one frame IntPtr lpbiPrev, // format of previous frame IntPtr lpPrev // previous frame );
The code that calls ICCompress is
// Setup compressor compressorHnd = Avi.ICOpen(Avi.FOURCC.ICTYPE\_VIDEO, Avi.FOURCC.mmioFOURCC('L','E','A','D'), Avi.ICMODE.ICMODE\_COMPRESS); outbi = new Avi.BITMAPINFOHEADER(); inbi = new Avi.BITMAPINFOHEADER
-
Hi Im having trouble with a imported function called ICCompress. Im not sure if I have transled the function properly can someone help me? Native
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;DWORD ICCompress(
HIC hic,
DWORD dwFlags,
LPBITMAPINFOHEADER lpbiOutput,
LPVOID lpData,
LPBITMAPINFOHEADER lpbiInput,
LPVOID lpBits,
LPDWORD lpckid,
LPDWORD lpdwFlags,
LONG lFrameNum,
DWORD dwFrameSize,
DWORD dwQuality,
LPBITMAPINFOHEADER lpbiPrev,
LPVOID lpPrev
);C# code
\[StructLayoutAttribute(LayoutKind.Sequential)\] public struct BITMAPINFOHEADER { public uint biSize; public int biWidth; public int biHeight; public ushort biPlanes; public ushort biBitCount; public uint biCompression; public uint biSizeImage; public int biXPelsPerMeter; public int biYPelsPerMeter; public uint biClrUsed; public uint biClrImportant; } \[DllImport("MSVFW32.dll")\] public static extern int ICCompress( IntPtr hic, UInt32 dwFlags, // flags ref BITMAPINFOHEADER lpbiOutput, // output format IntPtr lpData, // output data ref BITMAPINFOHEADER lpbiInput, // format of frame to compress IntPtr lpBits, // frame data to compress out UInt32 lpckid, // ckid for data in AVI file out UInt32 lpdwFlags, // flags in the AVI index. int lFrameNum, // frame number of seq. UInt32 dwFrameSize, // reqested size in bytes. (if non zero) UInt32 dwQuality, // quality within one frame IntPtr lpbiPrev, // format of previous frame IntPtr lpPrev // previous frame );
The code that calls ICCompress is
// Setup compressor compressorHnd = Avi.ICOpen(Avi.FOURCC.ICTYPE\_VIDEO, Avi.FOURCC.mmioFOURCC('L','E','A','D'), Avi.ICMODE.ICMODE\_COMPRESS); outbi = new Avi.BITMAPINFOHEADER(); inbi = new Avi.BITMAPINFOHEADER
Ok i think that the problem is that I havnt specified the correct format in lpbiOutput. So I need to get the correct output format. I found a function called ICCompressGetFormat but I dont know how to use it. Can I import this function?
-
Ok i think that the problem is that I havnt specified the correct format in lpbiOutput. So I need to get the correct output format. I found a function called ICCompressGetFormat but I dont know how to use it. Can I import this function?
When you want to provide more info, and if you're not responding to a reply, edit the original message.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001