procedure TSkinEngine.DrawAlphaBlend(
DC: HDC; X, Y, ClientWidth, ClientHeight: Integer;
fBlend: Byte);
var
hTempDC: HDC;
bf: BLENDFUNCTION;
hBmp: HBITMAP;
bmi: BITMAPINFO;
pvBits: Pointer;
begin
hTempDC := CreateCompatibleDC(
DC);
ZeroMemory(@bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize := sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth := ClientWidth;
bmi.bmiHeader.biHeight := ClientHeight;
bmi.bmiHeader.biPlanes := 1;
bmi.bmiHeader.biBitCount := 32;
bmi.bmiHeader.biCompression := BI_RGB;
bmi.bmiHeader.biSizeImage := ClientWidth * ClientHeight * 4;
hBmp := CreateDIBSection(hTempDC, bmi, DIB_RGB_COLORS, pvBits, 0, 0);
SelectObject(hTempDC, hBmp);
bf.BlendOp := AC_SRC_OVER;
bf.BlendFlags := 0;
bf.SourceConstantAlpha := fBlend;
bf.AlphaFormat := 0;
AlphaBlend(
DC, X, Y, ClientWidth, ClientHeight, hTempDC, 0, 0, ClientWidth, ClientHeight, bf);
DeleteObject(hBmp);
DeleteDC(hTempDC);
end;