upgrade from vb picturebox to vb.net picturebox
-
I want to upgrade one of the vb project to vb.net, but some method that is not support in vb.net, did anyone can help me?? The main problem is the picture.Point and picture.PSet not support in vb.net... Option Strict Off Option Explicit On Friend Class Form1 Inherits System.Windows.Forms.Form Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click Dim x, y As Integer Dim c, d As Integer Dim p1, p2 As Integer Dim B1, R1, G1 As Integer Dim B2, R2, G2 As Integer Dim t As Integer Dim r As Short Dim per As Integer Dim msg As String Picture3.Refresh() t = CInt(Text1.Text) Form1.DefInstance.Text = "Image Mapper - Mapping" Do Until y > VB6.PixelsToTwipsY(Picture1.Height) Or y > VB6.PixelsToTwipsY(Picture2.Height) p1 = Picture1.Point(x, y) p2 = Picture2.Point(x, y) RGB_get(p1, R1, B1, G1) RGB_get(p2, R2, B2, G2) Diff(r, R1, R2, B1, B2, G1, G2, t) If r = 0 Then d = d + 1 Picture3.PSet (x, y), System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue) Else Picture3.PSet (x, y), System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red) End If c = c + 1 x = x + 15 If x > VB6.PixelsToTwipsX(Picture1.Width) Or x > VB6.PixelsToTwipsX(Picture2.Width) Then x = 0 : y = y + 15 Loop per = 100 - ((d / c) * 100) msg = msg & "RESULTS" & vbCrLf msg = msg & "=============" & vbCrLf msg = msg & "Total Pixles Scanned: " & c & vbCrLf msg = msg & "Total Different Pixles: " & d & vbCrLf msg = msg & "Total Similar Pixles: " & (c - d) & vbCrLf msg = msg & "Percent Similar: " & per & " %" & vbCrLf If per > 75 Then msg = msg & "The computer has judged this as: SIMILAR" Else msg = msg & "The computer has judged this as: DIFFERENT" End If Form1.DefInstance.Text = "Image Mapper - Mapped" MsgBox(msg, CDbl(0 & 32), "Scan Complete:") End Sub End Class ption Strict Off Option Explicit On Module RGBCov Structure COLORRGB Dim red As Integer Dim green As Integer Dim blue As Integer End Structure Function RGB_get(ByVal CVal As Integer, ByRef r As Integer, ByRef B As Integer, ByRef G As Integer) As COLORRGB G = Int(CVal / 65536) B = Int((CVal - (65536 * G)) / 256) r = CVal - (65536 * G + 256 * B) End Function Function Diff(ByRef Result As Short, ByRef R1 As Integer, ByRef R2 As Integer, ByRef B1 As Integer, ByRef B2 As Integer,