|
As you're using VB.NET, you can't access the pixels directly, you'd have to loop over them using GetPixel.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
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
|
|
|
|
|
Sir/madam,
I was thinking of embeding the command button in the crystal reports 2005.
micosoft did not povide the command button.Can i use the access macros to do this.
in MS access reports i can invoke buttons to the reports.
Please help.
Thanks and regards
Panakj
|
|
|
|
|
Can anyone give me a code for convert PDF to DOC?
Thanks
................
|
|
|
|
|
There is no code to do this with the framework, not in a format that could be posted here, anyhow. You'd have to buy a component to do this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am invoking wordpad using system.diagnostics.process.start().
Is there a way to hide the toolbars ruler etc while opening wordpad from vb.net.I want all the main menu bar to be dispalyed with the opened file.
|
|
|
|
|
If there is, then it will be through command line arguments to wordpad. I seriously doubt it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can i get some detailed info on how to give the command line arguments?Thnks asha
-- modified at 2:54 Wednesday 11th April, 2007
|
|
|
|
|
How to Add the value in a particualr column say 2 as Combobox in a VSFlexGrid 7.0. There is some problem show at the runtime suppose we take flex as object of AXVSflexGrid and put the value in flex.set_colcombolist(2,"A"),but at runtime error comes like (An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.)
if anyone have project like this or what I hv 2 do. Pls help me as soon as possible.
-- modified at 8:09 Tuesday 24th April, 2007
|
|
|
|
|
Bishwajeet Roy wrote: hv
Vowels broken on your computer ?
VB.Net is not a header that will attract the attention of people who can help. 'Add values in columns' would be an example of a sensible header.
Why are you using a VSFlexGrid in VB.NET ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sir/Madam,
Can i share my contol (textbox) - which is placed in the form - with other foms
Thanks and Regads
Pankaj
|
|
|
|
|
Yes , Remember form is Public Class, so you can get the values of textbox
Develop2Program & Program2Develop
|
|
|
|
|
well you can do this thing by making a public member object
look at this in form one under a button clicking event
dim myform as new form2
myform.yourpublicmember= textbox1.text
in form two in form load event
Public YourPublicMember As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = YourPublicMember
End Sub
|
|
|
|
|
add the msflxgrid.ocx control in u project eference
|
|
|
|
|
I just love the arrogance of some of these posts.
Ask about some line of code after spending hours trying to solve a problem, fair enough.
But to just demand someone send you some sourcecode.
Have you even bothered to try and figure this yourself?
Or maybe your so stuck up, you expect everyone is here to serve you?
Maybe some effort before you start demanding, you're get more respect!
|
|
|
|
|
Sir/Madam..
i have a problem with data grid in vb .Net 2003
can i insert a value to data grid without using binding??
|
|
|
|
|
Sorry i am not getting ur query
|
|
|
|
|
uhm....
sorry...
i don't know the code to add value into data grid without binding, so i need your advise. tq
|
|
|
|
|
without binding means? bining with database(wizard , manually). or what?
|
|
|
|
|
i mean without binding with data table or dataset (without database).
if in vb 6, we can add item to flexgrid with grid.textmatrix(row, col) = value
can we insert some value to data grid at VB .Net 2003 without bind or set it directly??
-- modified at 5:34 Tuesday 10th April, 2007
|
|
|
|
|
put allowusertoaddrows equal to true
hope this will sort out ur problem.
|
|
|
|
|
sorry...
what is allowusertoaddrows?? is that a property from data grid??
|
|
|
|
|
yes, it is a property
checkout this
http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.allowusertoaddrows.aspx
Lock N' Load
|
|
|
|
|
that is for component datagridview VB.NET 2005, there is no allowusertoaddrows property at component data grid VB.NET 2003
|
|
|
|
|
yes a property of datagridview in 2005
|
|
|
|