Can someone help me complete my code , i don't know how to click and move the image I found on google the code
[DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
[Flags]
public enum MouseEventFlags
{
LEFTDOWN = 0x000000002,
LEFTUP = 0x000000004,
MIDDLEDOWN = 0x000000020,
MIDDLEUP = 0x000000040,
MOVE = 0x000000001,
ABSOLUTE = 0x000008000,
RIGHTDOWN = 0x000000008,
RIGHTUP = 0x000000010,
}
public void mousedown(Point p)
{
Cursor.Position = p;
mouse_event((int)(MouseEventFlags.LEFTDOWN), 0, 0, 0, 0);
}
Code find image and move it
private void btntestcode_Click(object sender, EventArgs e)
{
var screen = CaptureHelper.CaptureScreen();
var subBitmap = ImageScanOpenCV.GetImage("testmousemove.PNG");
var resBitmap = ImageScanOpenCV.FindOutPoint((Bitmap)screen, subBitmap);
if (resBitmap != null)
{
mousedown((Point)resBitmap);
}
}
