function TBassPlayer.CreateDIBSection(
DC: HDC; Width, Height, BitCount: Integer): HBitmap;
var
bi: BITMAPINFO;
begin
// BITMAPINFOHEADER befuellen
ZeroMemory(@bi, sizeof(BITMAPINFO));
bi.bmiHeader.biSize := sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biWidth := FWidth;
bi.bmiHeader.biHeight := -FHeight;
bi.bmiHeader.biPlanes := 1;
bi.bmiHeader.biBitCount := Word(BitCount);
bi.bmiHeader.biCompression := BI_RGB;
bi.bmiHeader.biSizeImage := DWord(Abs(bi.bmiHeader.biHeight)) *
ByteAlignOnWord(Byte(bi.bmiHeader.biBitCount), bi.bmiHeader.biWidth);
Result := Windows.CreateDIBSection(
DC, bi, DIB_RGB_COLORS, pAddr, 0, 0);
end;
//..
hDibSec := CreateDIBSection(hTempDc, FWidth, FHeight, 24);