Vasguard
asked on
Using the GetObjectA Function in VB.NET
In vb6, the syntax is Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
The Problem: In VB.NET, the ANY datatype is no longer used so I replace ANY with OBJECT as displayed below:
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As OBJECT) As Long
and executed the function as:
xint = GetObject(PictureBox1.Hand le.ToInt32 , Len(picinfo), picinfo)
xint returns a value indicating the functions was successful, however. picinfo is all 0's.
Can anyone help?
The Problem: In VB.NET, the ANY datatype is no longer used so I replace ANY with OBJECT as displayed below:
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As OBJECT) As Long
and executed the function as:
xint = GetObject(PictureBox1.Hand
xint returns a value indicating the functions was successful, however. picinfo is all 0's.
Can anyone help?
BTW, the graphics handling capabilities in VB.NET are much more powerful than in VB6, so you may be able to accomplish what you are trying to do without using API calls. What is it you need to do using GetObjectA?
ASKER
I am new to vb.net but where are some good sites to learn about the graphics. All I am trying to do is compare two bitmaps and see if they are different or the same.
When you say comparing bitmaps, do you mean testing to see that each pixel is identical to the corresponding pixel in the other bitmap?
ASKER
Yes, I want to detect in changes in the pixels. Do you know how I could do that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Integer, ByVal nCount As Integer, ByRef lpObject As Object) As Integer