Search the Community
Showing results for tags 'overlapping'.
-
I'm writing a script which displays the png image in gui, the image size is not fixed (up to 50 * 50 pixels). So I had some problems with it: 1. After pressing the button, image display correctly, but after minimum and restore windows, image display inaccurate (resized to 50 * 50) 2. After the display the image 2, image 1 and image 2 overlap How to solve this problem, thanks for the help Sorry, my english is bad #include <GDIPlus.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) _GDIPlus_Startup() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 137, 67, 381, 238) GUISetOnEvent($GUI_EVENT_CLOSE, "_OnExit") $Pic1 = GUICtrlCreatePic("", 8, 8, 50, 50) $Button1 = GUICtrlCreateButton("Button1", 64, 8, 67, 25) GUICtrlSetOnEvent(-1, "_IMG") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func _OnExit() _GDIPlus_Shutdown() Exit EndFunc Func _IMG() MsgBox(0, "", "Show images 1") $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\icons1.png") $aBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, 0x0172, 0, $aBitmap)) _WinAPI_DeleteObject($aBitmap) MsgBox(0, "", "Show images 2") $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\icons2.png") $aBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, 0x0172, 0, $aBitmap)) _WinAPI_DeleteObject($aBitmap) EndFunc