SECTOR
Продвинутый
- Сообщения
- 399
- Репутация
- 59
Хотел создать градиент как в примере Yashied'a к функции _WinAPI_GradientFill,
но видимо я что-то делаю не правильно. Не могу понять что!
Помогите, кто чем может
но видимо я что-то делаю не правильно. Не могу понять что!

Код:
#include <WinAPI.au3>
#include <WinAPIEx.au3>
#include <SendMessage.au3>
Global Const $STM_SETIMAGE = 0x0172
Global Const $STM_GETIMAGE = 0x0173
$hGUI = GUICreate("Test",400,300)
GUICtrlCreateGradient($hGUI,30,0x000033)
GUISetState()
Do
Until GUIGetMsg() = -3
Func GUICtrlCreateGradient($hGUI,$iHeight,$iColor)
Local $aVertex[2][3] = [[0, 0, 0xFFFFFF], [0, $iHeight, $iColor]]
Local $aClientSize, $hPic, $hDC, $hDestDC, $hBitmap, $hDestSv, $hObj
$aClientSize = WinGetClientSize($hGUI)
$hPic = GUICtrlCreatePic("",0,0,$aClientSize[0],$iHeight)
$hDC = _WinAPI_GetDC($hPic)
$hDestDC = _WinAPI_CreateCompatibleDC($hDC)
$hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, 400, 400)
$hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap)
_WinAPI_GradientFill($hDestDC, $aVertex, 0)
_WinAPI_ReleaseDC($hPic, $hDC)
_WinAPI_SelectObject($hDestDC, $hDestSv)
_WinAPI_DeleteDC($hDestDC)
; Set gradient to control
_SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap)
$hObj = _SendMessage($hPic, $STM_GETIMAGE)
If $hObj <> $hBitmap Then
_WinAPI_DeleteObject($hBitmap)
EndIf
EndFunc
Помогите, кто чем может
