Jump to content

Recommended Posts

Posted

#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!

Posted (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)

Cheers

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

Edited by smashly
Posted

If found this

I don`t know about second param, but seems this work:

$aResult = DllCall("GDIPlus.dll", "int", "GdipSetTextRenderingHint", "ptr", $hGraphic, "int", 2)
:)
Posted

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

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
  • Recently Browsing   0 members

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