CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Vb2vc++

  1. #1
    Join Date
    Mar 2004
    Posts
    7

    Vb2vc++

    Hello,

    Could anybody pls help me in converting the coming vb code to VC++ code :

    With my thanks in advance
    Code:
     Const alpha = 1.5
        Dim x As Integer
        Dim y As Integer
        Dim i As Integer
        Dim n As Integer
        Dim resultTable(0 To 255) As Byte
        
        ' build a result table for lookup ...
        For n = 0 To 22
            For i = 0 To 255
                resultTable(i) = clip(128 + alpha * (i - 128))
            Next i
        Next n
        ' apply result table to the image ...
        For y = 1 To PicInfo.bmHeight
            For x = 1 To PicInfo.bmWidth
                img(1, x, y) = resultTable(img(1, x, y))
                img(2, x, y) = resultTable(img(2, x, y))
                img(3, x, y) = resultTable(img(3, x, y))
            Next x
        Next y

  2. #2
    Join Date
    Aug 2001
    Posts
    1,447
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  3. #3
    Join Date
    Oct 2003
    Location
    Philadelphia, PA
    Posts
    167
    While conversion tools always seem like a good idea to develop, and having pondered the idea myself given the robust analysis tehcnology and parsers we have, true conversion always seems to be an elusive goal, mostly becuase the architectural and function differences are too much to be worthwhile. Theoretically, if you convert down to the bottom, you could do it, but that seems like a really large effort.

    Anyway, most coversion does have to be done by someone conversant in both platforms. Good luck.
    Mike Dershowitz
    miked@lexientcorp.com
    www.lexientcorp.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured