代码加入进去后:效果:#include <GdiPlus.au3>
SetProcessDPIAware()
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @DesktopWidth = ' & @DesktopWidth &@TAB & '@DesktopHeight= ' & @DesktopHeight & @CRLF) ;### Debug Console
Func SetProcessDPIAware()
Local $Result = DllCall('User32.dll', 'BOOL', 'SetProcessDPIAware')
If @error Then Return SetError(@error, 0, False)
Return $Result[0]
EndFunc ;==>SetProcessDPIAware
$iDPI = 2
Local $aPos_Lefttop[2] = ['100', '126']
$iLeft = $aPos_Lefttop[0] * $iDPI
$iTop = $aPos_Lefttop[1] * $iDPI
_GDIPlus_Startup() ;initialize GDI+
$hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop) ok!
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC)
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing)
$hPen = _GDIPlus_PenCreate(0xFF00FF00, 4)
For $i = 1 To 40
_GDIPlus_GraphicsDrawRect($hGraphics, $iLeft, $iTop, $i * 30 * $iDPI, $i * 30 * $iDPI, $hPen)
_GDIPlus_GraphicsDrawString($hGraphics, $i, $iLeft + $i * 30 * $iDPI, $iTop , 'Arial', 15)
_GDIPlus_GraphicsDrawString($hGraphics, $i, $iLeft + $i * 30 * $iDPI, $iTop + $i * 30 * $iDPI, 'Arial', 15)
Next
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
;~ Exit
|