Click here to Skip to main content
15,919,500 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: The correct way to format a number Pin
Guffa10-Apr-07 0:50
Guffa10-Apr-07 0:50 
GeneralRe: The correct way to format a number Pin
Mark0610-Apr-07 1:01
Mark0610-Apr-07 1:01 
GeneralRe: The correct way to format a number Pin
Guffa10-Apr-07 2:17
Guffa10-Apr-07 2:17 
Questiondeployment Pin
amaneet10-Apr-07 0:42
amaneet10-Apr-07 0:42 
AnswerRe: deployment Pin
Christian Graus10-Apr-07 1:21
protectorChristian Graus10-Apr-07 1:21 
QuestionComparing 2 images Pin
Zaegra10-Apr-07 0:26
Zaegra10-Apr-07 0:26 
AnswerRe: Comparing 2 images Pin
Christian Graus10-Apr-07 1:22
protectorChristian Graus10-Apr-07 1:22 
AnswerRe: Comparing 2 images Pin
The ANZAC10-Apr-07 2:05
The ANZAC10-Apr-07 2:05 
on my form i had two pictureboxes (picturebox1 & picturebox2), both of which had the same image loaded, two labels (label1 & label2) and a button (button1).

 Dim image1 As Bitmap<br />
    Dim image2 As Bitmap<br />
    Dim v As Integer 'verical position<br />
    Dim vt As Integer 'total height<br />
    Dim h As Integer 'horizontal position<br />
    Dim ht As Integer 'total width<br />
    Dim thesame As Boolean = True<br />
<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
        image1 = PictureBox1.Image<br />
        image2 = PictureBox2.Image<br />
        v = 0<br />
        h = 0<br />
        vt = image1.Height<br />
        ht = image2.Width<br />
<br />
        Application.DoEvents()<br />
<br />
        For v = 0 To vt - 1<br />
            For h = 0 To ht - 1<br />
                If image1.GetPixel(h, v) <> image2.GetPixel(h, v) Then<br />
                    thesame = False<br />
                End If<br />
                Me.Label1.Text = h<br />
                Application.DoEvents()<br />
            Next<br />
            Me.Label2.Text = v<br />
            Application.DoEvents()<br />
        Next<br />
<br />
        If thesame = False Then<br />
            Me.Text = Me.Text & "   False"<br />
        Else<br />
            Me.Text = Me.Text & "   True"<br />
        End If<br />
<br />
    End Sub

Please note, this pixel by pixel comparison takes a long time, my image was relatively small, 500 x 300, larger images will take much longer. The filling of progress into the textboxes may have slowed the application down, but i used this to confirm it was all working, you can clean this up and do whatever you want with it.

The total width and height must have 1 taken away during comparison, due to the zero based indexing on images.

Also my images were identical in size and i haven't accomodated for variance in size, in this instance this comparator code would be redundant.





Posted by The ANZAC

Questionreports problem Pin
amaneet10-Apr-07 0:24
amaneet10-Apr-07 0:24 
QuestionConvert PDF to Word Document Pin
Socheat.Net10-Apr-07 0:18
Socheat.Net10-Apr-07 0:18 
AnswerRe: Convert PDF to Word Document Pin
Christian Graus10-Apr-07 1:23
protectorChristian Graus10-Apr-07 1:23 
Questionstarting wordpad from vb.net Pin
ashamsa9-Apr-07 23:46
ashamsa9-Apr-07 23:46 
AnswerRe: starting wordpad from vb.net Pin
Christian Graus10-Apr-07 1:24
protectorChristian Graus10-Apr-07 1:24 
GeneralRe: starting wordpad from vb.net [modified] Pin
ashamsa10-Apr-07 20:39
ashamsa10-Apr-07 20:39 
QuestionVB.Net [modified] Pin
Bishwajeet Roy9-Apr-07 23:29
Bishwajeet Roy9-Apr-07 23:29 
AnswerRe: VB.Net Pin
Christian Graus10-Apr-07 1:25
protectorChristian Graus10-Apr-07 1:25 
Questionsharing the control Pin
amaneet9-Apr-07 23:22
amaneet9-Apr-07 23:22 
AnswerRe: sharing the control Pin
Navneet Hegde9-Apr-07 23:38
Navneet Hegde9-Apr-07 23:38 
AnswerRe: sharing the control Pin
manni_n10-Apr-07 10:08
manni_n10-Apr-07 10:08 
AnswerRe: flexgrid Pin
amaneet9-Apr-07 22:57
amaneet9-Apr-07 22:57 
GeneralRe: flexgrid Pin
Mark0610-Apr-07 1:36
Mark0610-Apr-07 1:36 
QuestionDataGrid Pin
aphei9-Apr-07 22:25
aphei9-Apr-07 22:25 
AnswerRe: DataGrid Pin
amaneet9-Apr-07 23:00
amaneet9-Apr-07 23:00 
GeneralRe: DataGrid Pin
aphei9-Apr-07 23:13
aphei9-Apr-07 23:13 
GeneralRe: DataGrid Pin
amaneet9-Apr-07 23:17
amaneet9-Apr-07 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.