该法典使用了《最新消息》。
HDC hdc = GetWindowDC(hWnd);
int width = 400;
int height = 300;
HBITMAP hBitmap = CreateCompatibleBitmap(hdc, width, height);
HDC hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem, hBitmap);
BLENDFUNCTION blend = { 0 };
blend.BlendOp = AC_SRC_OVER;
blend.BlendFlags = 0;
blend.AlphaFormat = AC_SRC_ALPHA;
blend.SourceConstantAlpha = 255;
RECT rcClient;
GetClientRect(hWnd, &rcClient);
HBRUSH brush = CreateSolidBrush(RGB(128, 128, 128));
FillRect(hdcMem, &rcClient,brush);
POINT ptDst = { 0, 0 };
SIZE sizeWnd = { width, height };
POINT ptSrc = { 0, 0 };
UpdateLayeredWindow(hWnd, hdc, NULL, &sizeWnd, hdcMem, &ptSrc, 0, &blend, ULW_ALPHA);
// 释放资源
DeleteDC(hdcMem);
DeleteObject(hBitmap);
ReleaseDC(hWnd, hdc);
In my opinion, this window should be completely opaque, with a SourceConstantAlpha value of 255 for blend, but in reality, it is semi transparent. It looks like this But when i use RGB(255, 255, 255),it s completely opaque.And When i use RGB(0, 0, 0),it s compltely transparent. It seems that the RGB of brush affects transparency.I can t understand how the aplha blend.
我试图修改《刑法》和《刑法》。 两者都对甲型六氯环己烷的价值产生影响。 我已经咨询了温和会的文件。 表格为Dst.Alpha = Src.Alpha + (1 - Src.Alpha) * Dst.Alpha。 看来,如果来源商法为255,那么窗户就应该 op,但不是这样。 这对我来说非常令人困惑。 我想知道甲型肝脏如何。