Hi!

I've been programming in VB for about 2 years now, but I only started C++ 3 hours ago with this article I found

It basically explains how to make a DLL in C++ to handle arrays. But it only allows me to use 1 dimension arrays, and since this is for special effects in images, it needs to be 2d

Here's the code, in VB. I tried to translate but have no idea of where to start to get the values from the arrays at the positions I want.

Code:
Public Sub SpecialBltArray(SrcArray() As Byte, DestArray() As Byte, ByVal dX As Long, ByVal dY As Long, SrcX As Long, SrcY As Long, SrcWid As Long, SrcHgt As Long, LookupTable() As Byte)
    Dim cX As Long, cY As Long 'Loop counters
    Dim AbsX As Long, AbsY As Long 'X/Y values in the destination. This is used twice, so I calculate it only once to speed up :)
    
    'Loop trough all pixels...
    For cX = 0 To SrcWid
        For cY = 0 To SrcHgt
            'See the resulting value of crossing the effect's R/G/B value with the
            'destination's R/G/B value, in the lookup table.
            AbsX = dX + cX
            AbsY = dY + cY
            DestArray(AbsX, AbsY) = LookupTable(DestArray(AbsX, AbsY), SrcArray(SrcX + cX, SrcY + cY))
        Next cY
    Next cX
End Sub
That's all. There's no need for array bound checks, because it's all handled in VB, as well as the lookup table. I just need C++ for that little extra speed, VB is kinda slow in this kind of stuff