本文介绍了匹配图片框中的图案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚编写了一个程序,告诉您两个图片框中的图片是否相同,无论如何我都可以更改此代码,因此我可以例如一个图片框是一个圆圈,另一个图片是2个图片该程序可以告诉我他们是否在那里以及有多少.所有的圆圈都将具有相同的大小,所有的圆圈都将被复制并粘贴在油漆中.

I have just made a programe that tells you if the picture in two pictureboxs are the same , is there anyway I could change this code so I could for example if one picturebos was of a circle and the the other image was of 2 that the program could tell me if they''er there and how many. All the circles would be the same size all of them would be coypied and pasted in paint.

Dim result As Boolean = False
       Dim BPM1 As New Bitmap(PictureBox1.Image)
       Dim BPM2 As New Bitmap(PictureBox2.Image)
       Dim total As Integer
       Dim total_check As Integer
       total = 250 * 250
       For x As Integer = 0 To (250) - 1
           For y As Integer = 0 To (250) - 1
               If BPM1.GetPixel(x, y).Equals(BPM2.GetPixel(x, y)) Then
                   total_check = total_check + 1
                   If total_check = total Then
                       result = True
                   End If
               Else
                   result = False
               End If
           Next
       Next

       MessageBox.Show(result, "Compare")

推荐答案


这篇关于匹配图片框中的图案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 11:23