csharp

A collection of 5 posts

image

[Snippets]C# - 仿sikuli式的利用擷取圖片做按鍵精靈

最近有個需求是得去點擊某個程式的一些按鈕,但寫死座標位置使程式沒有彈性不是我的風格,最後就決定結合影像技術的方向來做一個仿sikuli利用截圖來點擊的偽按鍵精靈。以下是一些完成這目的的片段程式碼: Screenshot ``` int screenWidth = Screen.GetBounds(new Point(0, 0)).Width; int screenHeight = Screen.GetBounds(new Point(0, 0)).Height; Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);   // the final image used by memory reference Graphics gfx = Graphics.FromImage((Image)bmpScreenShot); gfx.CopyFromScreen(

  • hothero
    hothero
You've successfully subscribed to hothero's TechNote!