I'm creating 3 different sized buttons with bitmaps on them from the inet. Any idea why after adding a 2nd Global variable $hHBitmapM to the nice code provided by UEZ ('?do=embed' frameborder='0' data-embedContent>>) the script doesn't run but shows an error in the console:
!>11:50:07 AutoIt3.exe ended.rc:-1073741819
#include <GDIplus.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
_GDIPlus_Startup()
Global $hHBitmapL = _GDIPlus_BitmapCreateFromMemory(InetRead("http://icons.iconarchive.com/icons/hopstarter/soft-scraps/64/User-Administrator-Blue-icon.png"), 1)
Global $hHBitmapM = _GDIPlus_ImageResize($hHBitmapL,25,25)
;Global $hHBitmapM=$hHBitmapL
Global $hGUI = GUICreate("Bitmap from inet", 540, 396, -1, -1)
GUISetBkColor(0xFFFFFF)
Global $iBtnL = GUICtrlCreateButton("", 65, 89, 72, 72, $BS_BITMAP) , $hBtnL = GUICtrlGetHandle($iBtnL)
_WinAPI_DeleteObject(_SendMessage($hBtnL, $BM_SETIMAGE, $IMAGE_BITMAP, $hHBitmapL))
Global $iBtnM = GUICtrlCreateButton("", 65, 189, 25, 25, $BS_BITMAP) , $hBtnM = GUICtrlGetHandle($iBtnM)
_WinAPI_DeleteObject(_SendMessage($hBtnM, $BM_SETIMAGE, $IMAGE_BITMAP, $hHBitmapM))
GUISetState()
Do
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_WinAPI_DeleteObject($hHBitmapL)
_GDIPlus_Shutdown()
GUIDelete()
Exit
Case $iBtnL
MsgBox(0, "Info", "Image in button was downloaded from web and used directly without saving to disk first!")
Case $iBtnM
MsgBox(0, "Info", "Image in button was downloaded from web and used directly without saving to disk first!")
EndSwitch
Until False
Thanks