Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. upgrade from vb picturebox to vb.net picturebox

upgrade from vb picturebox to vb.net picturebox

Scheduled Pinned Locked Moved Visual Basic
helpcsharpgraphicsquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    khangwoi
    wrote on last edited by
    #1

    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,

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups