Sunday, December 8, 2013

Help with VB6 to VB.NET conversion!?

3d scanner box
 on Information about david-laserscanner.com: DAVID 3D Scanner
3d scanner box image



RjSowden


I'm asking this because I don't know anything about VB6 (It was around before I was born), and theirs no point in me having to spend 6 weeks learning all the functions ect... when their are others with a much better understanding who will get it right first time.

I need to convert this code :

Private WindowWidth
Private WindowHeight
Private threshold
Private rgbvalue

Private Sub Form_Load()
'
WindowWidth = 320
WindowHeight = 240
myy = 1

End Sub

Private Sub Timer1_Timer()

Dim R As Long
Dim G As Long
Dim B As Long

Dim myx
Dim myy
Dim rgbvalue

threshold = Slider1.Value '1600000 '3876853 'Reverse BGR hex value for a red colour
Text1.Text = threshold
threshold = 1585276

myy = 1

mynumber = 1
mytextnumber$ = mynumber

Form1.Picture3 = LoadPicture("D:\Colin Ord\3d scanner\3D Scanner RT 2009\rgb.jpg")

mytextnumber$ = "D:\Colin Ord\3d scanner\3D Scanner RT 2009\" & "1.jpg"

On Error GoTo ErrorHandler

ErrorHandler:
If Err.Number = 53 Or 481 Then
'Debug.Print "Some problem with loading jpg image."
Resume Next
End If

Picture1 = LoadPicture(mytextnumber$)

For xcnt = 0 To WindowWidth
If Picture1.Point(xcnt, 30) > threshold Then '100000 Then
origin = xcnt

GoTo start:
End If
Next

start:

For myy = 0 To WindowHeight

For myx = 0 To WindowWidth
If Picture1.Point(myx, myy) > threshold Then '1000000 Then
GoTo here:
End If
Next

here:

Picture1.PSet (myx, myy), RGB(255, 255, 0)
Picture1.Line (0, 30)-(WindowWidth, 30), RGB(0, 255, 0)

If Form1.Picture3.Point(myx, myy) > 100000 Then
rgbvalue = Form1.Picture3.Point(myx, myy)
End If

rotx = origin - myx
roty = myy * 2
rotz = (rotx + myx) / 2

'Output file
Open "D:\Colin Ord\3d scanner\3D Scanner RT 2009\freescanRGB_object_01.asc" For Append As #1

'Read RGB values from hex pixel colour
R = &HFF& And rgbvalue
G = (&HFF00& And rgbvalue) \ 256
B = (&HFF0000 And rgbvalue) \ 65536

' Aligns scan with laser angle offset and skew
rot = 30 * 0.0174532 '57.29577951
rotzz = rotz * Cos(rot) - myx * Sin(rot)
rotxx = rotz * Sin(rot) + myx * Cos(rot)
rotyy = roty 'myy '/ 2

'create the vertex string - 'X Y Z R G B'
Print #1, ((rotxx + rotx) & " " & (rotyy / 2) & " " & ((rotzz * -2) * 2) & " " & R & " " & G & " " & B)
Close #1

'LASER LINE PREVIEW BOX- Draws each vertex with a red dot.
Picture2.PSet (myx, myy), RGB(255, 0, 0)
Next

End Sub

...Into VB.NET So I can tweak it and put it into my own application. I got it from text right off the internet, so I cant try to import it into .NET and let that convert it for me, because I cant save it. Thanks to everyone who can give advice, and I'll definitely give out a best answer. Thanks so much again in advance!
I do know that the Timer class doe's need a handler. I know VB.NET well. Picture3 defines a picture box control



Answer
It looks like either your code is not complete or there is a reference library that you're going to need for this.

Form1.Picture3 = LoadPicture("D:\Colin Ord\3d scanner\3D Scanner RT 2009\rgb.jpg")

LoadPicture is not defined anywhere in the code you posted. There is also nothing listed here to make the Timer1_Timer sub run.

You're going to have to find the missing parts to this project if you want to use it as written. Otherwise you're going to have to disect it pulling out bits & pieces to make it work for you.

resident evil code veronica x metal detectors?




linker21


i stuck on this part how can i pass it possibley give me a link


Answer
If you haven't, grab the fire extinguisher from the shutter room before you enter the building with the metal detectors. You have to put out that fire that explodes at the beginning by the cemetery. Inside the suitcase is an TG alloy material item that can't be detected by metal detectors. Go back in the building and past the 2nd metal detector. Grab the Hawk emblem from the security box and take it to the big machine by the table. It's the 3d scanner.

*set off the metal detectors to close the windows and shutters, or zombies will get in and you have no weapons.*

Place it in there and place the alloy in he machine next to it to make a duplicate. Take the duplicate and go handle your business!




Powered by Yahoo! Answers

Title Post: Help with VB6 to VB.NET conversion!?
Rating: 100% based on 99998 ratings. 5 user reviews.
Author: Yukie

Thanks For Coming To My Blog

No comments:

Post a Comment