Problem with API
-
Public Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Integer, ByVal wFillType As Integer) As Integer I want above API use with VB.NET. But I can't found hdc property in Picturebox control. Any body tell me how to use this function.
-
Public Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Integer, ByVal wFillType As Integer) As Integer I want above API use with VB.NET. But I can't found hdc property in Picturebox control. Any body tell me how to use this function.
Take a look at this[^], and see if you can work out how to apply it to a PictureBox. BTW, unless you absolutely have to, avoid PictureBox. It is only good for displaying a picture that you will never, and I mean never, interact with.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Public Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Integer, ByVal wFillType As Integer) As Integer I want above API use with VB.NET. But I can't found hdc property in Picturebox control. Any body tell me how to use this function.
Hi ,
PictureBox1.Handle
is how you get the handel (hdc) you will require to change the declaration a bit , the new declaration of the API should be as following
Public Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill"
(ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal
crColor As Integer, ByVal wFillType As Integer) As IntegerHope this helps Let me know if you need further help
-Regards Bharat Jain bharat.jain.nagpur@gmail.com