本文整理汇总了C#中Win32.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Win32.Init方法的具体用法?C# Win32.Init怎么用?C# Win32.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Win32
的用法示例。
在下文中一共展示了Win32.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateBITMAPINFOHEADER32
public void PopulateBITMAPINFOHEADER32(ref Win32.BITMAPINFOHEADER bmih)
{
bmih.Init();
bmih.biPlanes = 1;
bmih.biBitCount = 32;
bmih.biHeight = height;
bmih.biWidth = width;
bmih.biSizeImage = (uint)(4 * width * height);
}
示例2: PopulateWAVEFORMATEX
public void PopulateWAVEFORMATEX(ref Win32.WAVEFORMATEX wfex)
{
int bytes = 0;
if (a_bits == 16) bytes = 2;
else if (a_bits == 8) bytes = 1;
else throw new InvalidOperationException("only 8/16 bits audio are supported by AviWriter and you chose: " + a_bits);
if (a_channels == 1) { }
else if (a_channels == 2) { }
else throw new InvalidOperationException("only 1/2 channels audio are supported by AviWriter and you chose: " + a_channels);
wfex.Init();
wfex.nBlockAlign = (ushort)(bytes * a_channels);
wfex.nChannels = (ushort)a_channels;
wfex.wBitsPerSample = (ushort)a_bits;
wfex.wFormatTag = Win32.WAVE_FORMAT_PCM;
wfex.nSamplesPerSec = (uint)a_samplerate;
wfex.nAvgBytesPerSec = (uint)(wfex.nBlockAlign * a_samplerate);
}