SetWindowRgnSee Also GetLastError, GetWindowRgnRequirements Runs on Versions Defined in Include Link to Windows CE OS 2.12 and later Winuser.h Winmgr.lib This function sets the window region of a window. The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region int SetWindowRgn( HWND hWnd, HRGN hRgn, BOOL bRedraw );
获取BMP大小,用CDC类中的API判断获取的点是不是透明的
再SETWINDOWSRGN一下!
GetLastError, GetWindowRgnRequirements
Runs on Versions Defined in Include Link to
Windows CE OS 2.12 and later Winuser.h Winmgr.lib
This function sets the window region of a window. The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region int SetWindowRgn(
HWND hWnd,
HRGN hRgn,
BOOL bRedraw
);
;设置窗口大小
invoke GetObject, g_hbmBackground, sizeof BITMAP, addr bm
invoke GetWindowRect, hWnd, addr rcWindow
invoke MoveWindow, hWnd, rcWindow.left, rcWindow.top, bm.bmWidth, bm.bmHeight, TRUE ;设置不规则性
invoke GetDC, hWnd
mov hdc, eax
invoke CreateCompatibleDC, hdc
mov hmemdc, eax
invoke SelectObject, hmemdc, g_hbmBackground
invoke GetPixel, hmemdc, 0, 0
mov colMask, eax
mov x, 0
mov y, 0
invoke CreateRectRgn, 0, 0, bm.bmWidth, bm.bmHeight
mov rgnWnd, eax .while TRUE
.while TRUE
invoke GetPixel, hmemdc, x, y
.if colMask == eax
mov ebx, x
inc ebx
mov edx, y
inc edx
invoke CreateRectRgn, x, y, ebx, edx
mov rgnTmp, eax
invoke CombineRgn, rgnWnd, rgnWnd, rgnTmp, RGN_XOR
invoke DeleteObject, rgnTmp
.endif
inc x
mov eax, x
.if eax >= bm.bmWidth
mov x, 0
.break
.endif
.endw
inc y
mov eax, y
.break .if eax >= bm.bmHeight
.endw
invoke SetWindowRgn, hWnd, rgnWnd, TRUE