taotao878 Posted May 7, 2008 Share Posted May 7, 2008 #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <GUIConstants.au3> #Include <WinAPI.au3> _GDIPlus_Startup () $GUI = GUICreate("WinNutClient", 640, 380, -1 , -1,Bitor($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN)) GuiSetState(@SW_SHOW,$GUI) $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($GUI) _GDIPlus_SetTextRenderingHint() _GDIPlus_GraphicsDrawString($hGraphic, "hello world",10,10, "Arial", 50) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_Shutdown () Func _GDIPlus_SetTextRenderingHint() Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipSetTextRenderingHint", "int", 2) Return $aResult EndFunc ;==>_GDIPlus_SetTextRenderingHint The above code is unsuccessful. How to do it ? Thanks! Link to comment Share on other sites More sharing options...
smashly Posted May 7, 2008 Share Posted May 7, 2008 (edited) Hi,I have no idea what the function does, but your missing the hwnd $hGraphic from the dll call.$aResult = DllCall($ghGDIPDll, "int", "GdipSetTextRenderingHint", "hwnd", $hGraphic , "int", 2)CheersEdit: should of been "hwnd" and not "int" Edited May 7, 2008 by smashly Link to comment Share on other sites More sharing options...
rasim Posted May 7, 2008 Share Posted May 7, 2008 If found thisI don`t know about second param, but seems this work:$aResult = DllCall("GDIPlus.dll", "int", "GdipSetTextRenderingHint", "ptr", $hGraphic, "int", 2) Link to comment Share on other sites More sharing options...
smashly Posted May 7, 2008 Share Posted May 7, 2008 the reason I opted for "hwnd" over "ptr" or "int" was I looked through the GDIPlus.au3 udf. just about all the functions that involve $hGraphic in a gdi call seem to use "hwnd" Cheers Link to comment Share on other sites More sharing options...
rasim Posted May 7, 2008 Share Posted May 7, 2008 smashlyYes, you are right. Link to comment Share on other sites More sharing options...
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