Jump to content

How to set text rendering hint ?


Recommended Posts

#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

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)

Cheers

Edit: should of been "hwnd" and not "int"

Edited by smashly
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...