#Include <ButtonConstants.au3>
#Include <GDIPlus.au3>
#Include <WinAPIEx.au3>
$hForm = GUICreate('MyGUI', 128, 128)
$Button = GUICtrlCreateButton('', 32, 32, 64, 64, $BS_BITMAP)
_GDIPlus_Startup()
$hPng = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\Silverlight.png')
$hBitmap = _GDIPlus_DIBitmapCreateFromBitmap($hPng)
_GDIPlus_ImageDispose($hPng)
_GDIPlus_ShutDown()
;GUICtrlSendMsg(-1, $BM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
GUICtrlSendMsg(-1, 0x00F7, 0, $hBitmap)
GUISetState()
Do
Until GUIGetMsg() = -3
Func _GDIPlus_DIBitmapCreateFromBitmap($hBitmap)
Local $tBIHDR, $tMap, $pBits, $hImage, $hResult, $Width, $Height
$Width = _GDIPlus_ImageGetWidth($hBitmap)
$Height = _GDIPlus_ImageGetHeight($hBitmap)
If ($Width < 1) Or ($Height < 1) Then
Return 0
EndIf
$hImage = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $Width, $Height, $GDIP_PXF32ARGB)
$tMap = _GDIPlus_BitmapLockBits($hImage, 0, 0, $Width, $Height, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
$tBIHDR = DllStructCreate($tagBITMAPINFOHEADER)
DllStructSetData($tBIHDR, 'biSize', DllStructGetSize($tBIHDR))
DllStructSetData($tBIHDR, 'biWidth', $Width)
DllStructSetData($tBIHDR, 'biHeight', $Height)
DllStructSetData($tBIHDR, 'biPlanes', 1)
DllStructSetData($tBIHDR, 'biBitCount', 32)
DllStructSetData($tBIHDR, 'biCompression', $BI_RGB)
$hResult = _WinAPI_CreateDIBSection(0, $tBIHDR, $DIB_RGB_COLORS, $pBits)
If Not @error Then
_WinAPI_SetBitmapBits($hResult, $Width * $Height * 4, DllStructGetData($tMap, 'Scan0'))
EndIf
_GDIPlus_BitmapUnlockBits($hImage, $tMap)
_GDIPlus_BitmapDispose($hImage)
Return $hResult
EndFunc ;==>_GDIPlus_DIBitmapCreateFromBitmap
SANILA сказал(а):Yashied объясни пожалуйста что делает функция _GDIPlus_DIBitmapCreateFromBitmap?
Yashied сказал(а):P.S
На XP не проверял.
>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Администратор.MICROSOF-028764\Рабочий стол\AutoIt v3 Script.au3"
C:\Documents and Settings\?????????????.MICROSOF-028764\??????? ????\AutoIt v3 Script.au3 (32) : ==> Variable used without being declared.:
$tBIHDR = DllStructCreate($tagBITMAPINFOHEADER)
$tBIHDR = DllStructCreate(^ ERROR
>Exit code: 1 Time: 0.311
Есть. И GDIPlus.au3 тоже есть.madmasles сказал(а):А у Вас есть WinAPIEx.au3?
Global Const $tagBITMAPINFOHEADER = 'dword biSize;long biWidth;long biHeight;ushort biPlanes;ushort biBitCount;dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;'
Humanoid сказал(а):
#include <AutoRun.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#Include <GDIPlus.au3>
#Include <WinAPIEx.au3>
_AutoRunAdd()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("World of the Rest - Click'er", 339, 93, 194, 114)
$Label1 = GUICtrlCreateLabel("Игрок:", 18, 12, 33, 17)
$Login = GUICtrlCreateInput("", 78, 9, 121, 21)
$Label2 = GUICtrlCreateLabel("Пароль:", 11, 39, 40, 27)
$Pass = GUICtrlCreateInput("", 78, 36, 121, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$Send = GUICtrlCreateButton("Старт", 10, 63, 75, 21, $BS_BITMAP)
$Exit = GUICtrlCreateButton("Выход", 125, 63, 75, 21, 0)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hPng = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\Silverlight.png')
$hBitmap = _GDIPlus_DIBitmapCreateFromBitmap($hPng)
_GDIPlus_ImageDispose($hPng)
_GDIPlus_ShutDown()
;GUICtrlSendMsg(-1, $BM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
GUICtrlSendMsg(-1, 0x00F7, 0, $hBitmap)
GUISetState()
Do
Until GUIGetMsg() = -3
Func _GDIPlus_DIBitmapCreateFromBitmap($hBitmap)
Local $tBIHDR, $tMap, $pBits, $hImage, $hResult, $Width, $Height
$Width = _GDIPlus_ImageGetWidth($hBitmap)
$Height = _GDIPlus_ImageGetHeight($hBitmap)
If ($Width < 1) Or ($Height < 1) Then
Return 0
EndIf
$hImage = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $Width, $Height, $GDIP_PXF32ARGB)
$tMap = _GDIPlus_BitmapLockBits($hImage, 0, 0, $Width, $Height, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
$tBIHDR = DllStructCreate($tagBITMAPINFOHEADER)
DllStructSetData($tBIHDR, 'biSize', DllStructGetSize($tBIHDR))
DllStructSetData($tBIHDR, 'biWidth', $Width)
DllStructSetData($tBIHDR, 'biHeight', $Height)
DllStructSetData($tBIHDR, 'biPlanes', 1)
DllStructSetData($tBIHDR, 'biBitCount', 32)
DllStructSetData($tBIHDR, 'biCompression', $BI_RGB)
$hResult = _WinAPI_CreateDIBSection(0, $tBIHDR, $DIB_RGB_COLORS, $pBits)
If Not @error Then
_WinAPI_SetBitmapBits($hResult, $Width * $Height * 4, DllStructGetData($tMap, 'Scan0'))
EndIf
_GDIPlus_BitmapUnlockBits($hImage, $tMap)
_GDIPlus_BitmapDispose($hImage)
Return $hResult
EndFunc
#EndRegion ### END Koda GUI section ###
While 1
WEnd