seniors 发表于 2013-6-4 21:03:03

_GDIPlus_PathWarp错误

_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
        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], ($iI - 1) * 2 + 1)
                DllStructSetData($tPoints, 1, $aPoints[$iI], ($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
        Return $aResult = 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
        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], ($iI - 1) * 2 + 1)
                DllStructSetData($tPoints, 1, $aPoints[$iI], ($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
        Return $aResult = 0
EndFunc   ;==>_GDIPlus_PathWarp
页: [1]
查看完整版本: _GDIPlus_PathWarp错误