#Include <GDIPlus.au3>
#Include <Memory.au3>
#Include <WinAPIEx.au3>
;#include <IE.au3>
Global Const $STM_SETIMAGE = 0x0172
Global Const $STM_GETIMAGE = 0x0173
Global $hForm, $Pic, $hPic, $hBitmap, $hObj, $hImage, $hStream, $bData, $hData, $pData, $tData, $Width, $Height, $Lenght
;$oIE = _IECreate('bwc.ru/cgi-bin/smssend.cgi')
;$oCap = _IEGetObjById($oIE ,'code_img')
;$bData = InetRead($oCap.src, 17)
$bData = InetRead('http://www.google.ru/logos/2012/bram-stoker-2012-hp.jpg', 17)
$Lenght = BinaryLen($bData)
$hData = _MemGlobalAlloc($Lenght, 2)
$pData = _MemGlobalLock($hData)
$tData = DllStructCreate('byte[' & $Lenght & ']', $pData)
DllStructSetData($tData, 1, $bData)
_MemGlobalUnlock($hData)
$hStream = _WinAPI_CreateStreamOnHGlobal($hData)
_GDIPlus_Startup()
$hImage = _GDIPlus_BitmapCreateFromStream($hStream)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$Width = _GDIPlus_ImageGetWidth($hImage)
$Height = _GDIPlus_ImageGetHeight($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
$hForm = GUICreate($Width & 'x' & $Height, $Width + 100, $Height + 100)
$Pic = GUICtrlCreatePic('', 10 , 10)
$hPic = GUICtrlGetHandle($Pic)
_SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap)
$hObj = _SendMessage($hPic, $STM_GETIMAGE)
If $hObj <> $hBitmap Then
_WinAPI_DeleteObject($hBitmap)
EndIf
GUISetState()
Do
Until GUIGetMsg() = -3
Func _GDIPlus_BitmapCreateFromStream($hStream)
Local $aResult = DllCall($ghGDIPDll, 'uint', 'GdipCreateBitmapFromStream', 'ptr', $hStream, 'int*', 0)
If @error Then
Return SetError(@error, @extended, 0)
EndIf
Return $aResult[2]
EndFunc ;==>_GDIPlus_BitmapCreateFromStream