Custom Query (3927 matches)
Results (289 - 291 of 3927)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #290 | Completed | _WinAPI_FloatToInt() --> obsolete in GDIPlus.au3 | ||
| Description |
_WinAPI_FloatToInt() is declared in WinApi.au3 UDF and it's used in GDIPlus.au3 UDF only. PaulIA created it in his Auto3Library as workaround for missing float type support in DllCall(). But later Jon added support for float type into DllCall() but PaulIA has left forum already so this (now not neccessary) workaround is still there. Princip of workaround was in creating structure for DllCall with int type instead of float and place data into it converted by _WinAPI_FloatToInt(). Then in DllCall() was used type int instead of float. It's nice visible in this example for _GDIPlus_DrawImagePoints() I removed workaround and tested it on WINXP - it works OK: _GDIPlus_DrawImagePoints2() is corrected original _GDIPlus_DrawImagePoints(): #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hBitmap1, $hBitmap2, $hImage1, $hImage2, $hGraphic
; Initialize GDI+ library
_GDIPlus_Startup()
; Capture full screen
$hBitmap1 = _ScreenCapture_Capture("")
$hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
; Capture screen region
$hBitmap2 = _ScreenCapture_Capture("", 0, 0, 400, 300)
$hImage2 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap2)
; Draw one image in another
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1)
_GDIPlus_DrawImagePoints2($hGraphic, $hImage2, 100, 100, 600, 170, 130, 570)
; Draw a frame around the inserted image
_GDIPlus_GraphicsDrawRect($hGraphic, 100, 100, 400, 300)
; Save resultant image
_GDIPlus_ImageSaveToFile($hImage1, @ScriptDir & "\GDIPlus_Image.jpg")
; Clean up resources
_GDIPlus_ImageDispose($hImage1)
_GDIPlus_ImageDispose($hImage2)
_WinAPI_DeleteObject($hBitmap1)
_WinAPI_DeleteObject($hBitmap2)
; Shut down GDI+ library
_GDIPlus_Shutdown()
EndFunc ;==>_Main
Func _GDIPlus_DrawImagePoints2($hGraphic, $hImage, $nULX, $nULY, $nURX, $nURY, $nLLX, $nLLY, $count = 3)
Local $tPoint, $pPoint, $aResult
$tPoint = DllStructCreate("float X;float Y;float X2;float Y2;float X3;float Y3")
DllStructSetData($tPoint, "X", $nULX)
DllStructSetData($tPoint, "Y", $nULY)
DllStructSetData($tPoint, "X2", $nURX)
DllStructSetData($tPoint, "Y2", $nURY)
DllStructSetData($tPoint, "X3", $nLLX)
DllStructSetData($tPoint, "Y3", $nLLY)
$pPoint = DllStructGetPtr($tPoint)
$aResult = DllCall($ghGDIPDll, "int", "GdipDrawImagePoints", _
"hwnd", $hGraphic, _
"hwnd", $hImage, _
"ptr", $pPoint, _
"int", $count)
Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc ;==>_GDIPlus_DrawImagePoints
;~ Func _GDIPlus_DrawImagePoints($hGraphic, $hImage, $nULX, $nULY, $nURX, $nURY, $nLLX, $nLLY, $count = 3)
;~ Local $iULX, $iULY, $iURX, $iURY, $iLLX, $iLLY, $tPoint, $pPoint, $aResult
;~
;~ $iULX = _WinAPI_FloatToInt($nULX)
;~ $iULY = _WinAPI_FloatToInt($nULY)
;~ $iURX = _WinAPI_FloatToInt($nURX)
;~ $iURY = _WinAPI_FloatToInt($nURY)
;~ $iLLX = _WinAPI_FloatToInt($nLLX)
;~ $iLLY = _WinAPI_FloatToInt($nLLY)
;~ $tPoint = DllStructCreate("int X;int Y;int X2;int Y2;int X3;int Y3")
;~ DllStructSetData($tPoint, "X", $iULX)
;~ DllStructSetData($tPoint, "Y", $iULY)
;~ DllStructSetData($tPoint, "X2", $iURX)
;~ DllStructSetData($tPoint, "Y2", $iURY)
;~ DllStructSetData($tPoint, "X3", $iLLX)
;~ DllStructSetData($tPoint, "Y3", $iLLY)
;~ $pPoint = DllStructGetPtr($tPoint)
;~ $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImagePoints", _
;~ "hwnd", $hGraphic, _
;~ "hwnd", $hImage, _
;~ "ptr", $pPoint, _
;~ "int", $count)
;~ Return SetError($aResult[0], 0, $aResult[0] = 0)
;~ EndFunc ;==>_GDIPlus_DrawImagePoints
|
|||
| #291 | No Bug | TCPRecv() example in help file incorrect | ||
| Description |
Line:
Gets an error and should be changed to
"int" instead of "int_ptr" |
|||
| #292 | Fixed | _EventLog__Clear() | ||
| Description |
my os: windows xp pro sp3 clear eventlog without backup is not working. A. _EventLog__Clear($hEventLog) ;error message B. _EventLog__Clear($hEventLog,"") ;eventlog is not cleared Thanks. |
|||
