728x90
728x170

커서 모양을 다른 걸로 변경하고 싶을때

.cur 파일을 만드는 방법이 있다.

하지만 번거롭다 그냥 이미지를 커서로 만드는 방법은 아래와 같다.

            Image image = Bitmap.FromFile("pen.png");
            Bitmap bitmap = new Bitmap(image);
            Graphics graphics = Graphics.FromImage(bitmap);
            IntPtr handle = bitmap.GetHicon();
            Cursor penCursor = new Cursor(handle);

 

728x90
그리드형

'C# > Winform' 카테고리의 다른 글

Win API  (0) 2018.03.18
FileSystemWatcher (폴더 모니터링 기능)  (3) 2018.03.15
(C#) 방화벽 뚫기 코드  (0) 2018.03.03
How to generate a PDF from HTML using wkhtmltopdf with C# in WinForms  (0) 2018.03.02
(C#) ShuffleArray  (0) 2018.02.24
Posted by kjun
,