728x90
반응형
728x170
▶ Cursor 클래스 : 이미지 커서 구하기 예제
using System.Drawing;
using System.Windows.Forms;
Image image = Image.FromFile("hourglass.png");
Cursor cursor = GetImageCursor(image);
728x90
▶ Cursor 클래스 : 이미지 커서 구하기
using System;
using System.Drawing;
using System.Windows.Forms;
#region 이미지 커서 구하기 - GetImageCursor(image)
/// <summary>
/// 이미지 커서 구하기
/// </summary>
/// <param name="image">이미지</param>
/// <returns>커서</returns>
public Cursor GetImageCursor(Image image)
{
Bitmap bitmap = new Bitmap(image);
Graphics graphics = Graphics.FromImage(bitmap);
IntPtr handle = bitmap.GetHicon();
Cursor cursor = new Cursor(handle);
return cursor;
}
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WinForm' 카테고리의 다른 글
[C#/WINFORM] 디자인 모드 여부 구하기 (0) | 2018.10.14 |
---|---|
[C#/WINFORM] 디자인 모드 여부 구하기 (0) | 2018.10.14 |
[C#/WINFORM] YOLO 이미지 객체 인식하기 (0) | 2018.09.22 |
[C#/WINFORM] 유사 이미지 찾기 (0) | 2018.09.20 |
[C#/WINFORM] 텐서플로우를 사용해 물체 인식하기 (0) | 2018.09.01 |
[C#/WINFORM] DataGridView 클래스 : RowPostPaint 이벤트를 사용해 행 번호 표시하기 (0) | 2018.09.01 |
[C#/WINFORM] DataGridView 클래스 : 마우스를 사용해 항목 순서 변경하기 (0) | 2018.09.01 |
[C#/WINFORM] 텐서플로우를 사용해 물체 인식하기 (0) | 2018.08.29 |
[C#/WINFORM] Control 클래스 : ProcessCmdKey 메소드를 사용해 COPY/PASTE/CUT 방지하기 (0) | 2018.08.15 |
[C#/WINFORM] TextBox 클래스 : ShortcustsEnabled 속성을 사용해 COPY/PASTE/CUT 방지하기 (0) | 2018.08.15 |
댓글을 달아 주세요