找回密码
 加入
搜索
查看: 8219|回复: 0

[BUG报告] _GDIPlus_PathWarp错误

[复制链接]
发表于 2013-6-4 21:03:03 | 显示全部楼层 |阅读模式
_GDIPlus_PathWarp
原来代码如下,红色的Or应该改为And
Func _GDIPlus_PathWarp($hPath, $hMatrix, $aPoints, $nX, $nY, $nWidth, $nHeight, $iWarpMode = 0, $nFlatness = $FlatnessDefault)
        Local $iI, $iCount, $pPoints, $tPoints, $aResult

        $iCount = $aPoints[0][0]
        If $iCount <> 3 Or $iCount <> 4 Then
                $GDIP_ERROR = 1
                Return False
        EndIf

        $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
        $pPoints = DllStructGetPtr($tPoints)

        For $iI = 1 To $iCount
                DllStructSetData($tPoints, 1, $aPoints[$iI][0], ($iI - 1) * 2 + 1)
                DllStructSetData($tPoints, 1, $aPoints[$iI][1], ($iI - 1) * 2 + 2)
        Next

        $aResult = DllCall($ghGDIPDll, "uint", "GdipWarpPath", "hwnd", $hPath, "hwnd", $hMatrix, "ptr", $pPoints, "int", $iCount, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iWarpMode, "float", $nFlatness)
        If @error Then Return SetError(@error, @extended, False)

        $GDIP_STATUS = $aResult[0]
        Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PathWarp

应该改为
Func _GDIPlus_PathWarp($hPath, $hMatrix, $aPoints, $nX, $nY, $nWidth, $nHeight, $iWarpMode = 0, $nFlatness = $FlatnessDefault)
        Local $iI, $iCount, $pPoints, $tPoints, $aResult

        $iCount = $aPoints[0][0]
        If $iCount <> 3 And $iCount <> 4 Then
                $GDIP_ERROR = 1
                Return False
        EndIf

        $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
        $pPoints = DllStructGetPtr($tPoints)

        For $iI = 1 To $iCount
                DllStructSetData($tPoints, 1, $aPoints[$iI][0], ($iI - 1) * 2 + 1)
                DllStructSetData($tPoints, 1, $aPoints[$iI][1], ($iI - 1) * 2 + 2)
        Next

        $aResult = DllCall($ghGDIPDll, "uint", "GdipWarpPath", "hwnd", $hPath, "hwnd", $hMatrix, "ptr", $pPoints, "int", $iCount, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iWarpMode, "float", $nFlatness)
        If @error Then Return SetError(@error, @extended, False)

        $GDIP_STATUS = $aResult[0]
        Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PathWarp
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-22 12:03 , Processed in 0.069391 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表