i correct the range index error... instead 'or' i must use 'and':
Code:
'Shadow Effect
clrOldColor = RGBValues(lngBackColor)
If ((lngShadowX <> 0) Or (lngShadowY <> 0)) And (lngShadowColor <> lngBackColor) Then
If (ChangedImage(X, Y) <> RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)) Then
If X + lngShadowX <= outWidth - 1 And Y + ShadowY <= outHeight - 1 Then
If (ChangedImage(X + lngShadowX, Y + lngShadowY) = RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)) Then
Debug.Print "hi"
clrOldColor = RGBValues(lngShadowColor)
ChangedImage(X + lngShadowX, Y + lngShadowY) = vbRed
'Debug.Print RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)
End If
End If
End If
but by some reason don't enter on these 'if':
Code:
If (ChangedImage(X + lngShadowX, Y + lngShadowY) = RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)) Then
Debug.Print "hi"
clrOldColor = RGBValues(lngShadowColor)
ChangedImage(X + lngShadowX, Y + lngShadowY) = vbRed
'Debug.Print RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)
End If
these 'if' test if ChangedImage(X + lngShadowX, Y + lngShadowY) pixel position have these backcolor(RGB(clrOldColor.Blue, clrOldColor.Green, clrOldColor.Red)). on image test, i know that have it, but it's ignored and i don't understand why
can anyone advice me?