Wednesday, August 28, 2013

Help with VB6 to VB.NET conversion!?

3d scanner laser line
 on 636 HP Gross (SAE J1995), 610 HP Net (SAE J1349) @ 1800 rpm Improved ...
3d scanner laser line 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.

What are some cool FREE apps (for iPhone)?




southerngi


I wanted to know what some really cool appS are that I can put on to my iPhone. I am interested in fashion and like celebrity gossip and stuff related to that. FREE APPS ONLY :) 10 points for the most and best apps :)


Answer
Favorites marked with a â.
Free apps marked with a â»

â¶Good for professional/school:

â¢Air Sharing â
â¢Alarm System â
â¢Color Splash
â¢Delivery Status touch â
â¢Dial Zero â â»
â¢eBay Mobile â»
â¢Facebook (&fun) â»
â¢Fake-a-call (&fun) â»
â¢Flashlight â â»
â¢Flight Track
â¢Graphing Calculator
â¢If Found â â»
â¢iRibbit â»
â¢Last.fm â»
â¢Linguo â
â¢Night Camera
â¢Police Scanner
â¢QuickTip â»
â¢RedLaser â
â¢Remote â»
â¢Shazam â â»
â¢Showtime â»
â¢Sportacular â â»
â¢Taxi!
â¢Units â»
â¢Vicinity
â¢The Weather Channel â â»
â¢Yellow Pages â â»

â¶Good for fun:

â¢Arcade Bowling Lite â»
â¢Blocked
â¢BlocksClassic Lite â»
â¢Bounce On
â¢Bubble Wrap â â»
â¢Cacha Mouse 2
â¢Cro-Mag Rally
â¢Cube Runner â â»
â¢Cube Runner II
â¢Dog Whistle Free â â»
â¢Enigmo
â¢Expando free â»
â¢F-MyLife â â»
â¢Face Melter
â¢Falling Balls â»
â¢Fieldrunners â
â¢Flick Fishing
â¢Flight Control â
â¢Flight of the Hamsters
â¢Flood It! â»
â¢Hanoi â»
â¢Hearing Test : Prank
â¢I Can Has Cheezeburger (FailBlog and associated sites) â â»
â¢iBeer
â¢iBowl â
â¢iCopter â
â¢iFart Mobile
â¢iHunt 3D
â¢Illusions Scream : Prank
â¢iShake
â¢Jellycar â â»
â¢Joost â â»
â¢Labyrinth Lite â»
â¢Laser Tag
â¢Light Bike â»
â¢Line Rider iRide
â¢Mark of Mafia â â»
â¢MazeFinger
â¢Mood Touch
â¢The Moron Test â
â¢Moto Chaser
â¢Ocarina
â¢Ow My Balls â
â¢Pac-Man Lite â»
â¢Paper Football â»
â¢PapiJump â»
â¢Pocked God â
â¢PocketGuitar
â¢reMovem â»
â¢Rollercoaster Rush â»
â¢Scribble Lite â»
â¢SGN Golf
â¢:Shift:
â¢Sol Free Solitaire â â»
â¢Sonic Boom
â¢SPACE DEADBEEF â»
â¢Spawn â â»
â¢StickWars
â¢StoneLoops â
â¢Stop It free â»
â¢Tap Tap Revenge â»
â¢Target Practice
â¢Tetris â
â¢Toobz
â¢Topple 2
â¢Touchgrind
â¢Tris â»
â¢Zombieville USA â
â¢21 Pro Blackjack - Free â»
â¢9000 Awesome Facts â

â¶Hope this helps,
âââââââ⤵âââââââ
âââââââââââââââ
âââââââ⤴âââââââ




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