Merchants Posted July 14, 2015 Posted July 14, 2015 hii have a img loadit in a GUI done it with: _GDIPlus_StartUp() GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") Load_Img("any Pic", $GUI[0]) Sleep(1500) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _WinAPI_RedrawWindow($GUI[0]) Sleep(10) DirRemove(@ScriptDir & "\Img_Folder\",1) Func Load_Img($pic, $hwin) $hImage = _GDIPlus_ImageLoadFromFile($pic) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hwin) _WinAPI_RedrawWindow($hwin) EndFunc Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam) _WinAPI_RedrawWindow($GUI[0], 0, 0, $RDW_UPDATENOW) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 10, 75, 768, 576) ; Standaard Pal formaat _WinAPI_RedrawWindow($GUI[0], 0, 0, $RDW_VALIDATE) Return $GUI_RUNDEFMSG EndFuncbut the image is located in a folderif i want to delete the dir i said that the img file is in use by Autoitwhat can i do? Gr Merchants
UEZ Posted July 14, 2015 Posted July 14, 2015 _GDIPlus_ImageLoadFromFile($pic) locks the file! You have to dispose the handle before you can delete it.But if you dispose it you cannot work with it! Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Merchants Posted July 14, 2015 Author Posted July 14, 2015 (edited) _GDIPlus_ImageLoadFromFile($pic) locks the file! You have to dispose the handle before you can delete it.But if you dispose it you cannot work with it!and that can be done with this?_GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) Edited July 14, 2015 by Merchants
UEZ Posted July 14, 2015 Posted July 14, 2015 Yes, just after the Sleep line and don't forget _GDIPlus_Shutdown(). Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now