2019/08

    AddFontResource - Font(글꼴) 추가하기

    AddFontResource함수는 현재 System에 지정된 Font(글꼴)를 추가시키는 함수입니다. Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int AddFontResource(string lpFileName); ▶C# 선언 AddFontResource(path) ▶VB.NET 호출 AddFontResource(path); ▶C# 호출 함수의 path인수에는 추가할 Font File을 지정합니다. 예를 들어 abc.TTF(true type) 라는 글꼴 Fi..

    GetTextFace - 현재 Windows화면의 글꼴 확인

    GetTextFace함수는 현재 Windows화면의 글꼴관한 정보를 반환합니다. Declare Function GetTextFace Lib "gdi32" Alias "GetTextFaceA" (ByVal hdc As Integer, ByVal nCount As Integer, ByVal lpFacename As String) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int GetTextFace(int hdc, int nCount, StringBuilder lpStr); ▶C# 선언 GetTextFace함수의 첫번째 인수로는 현재 Windows화면의 Device Context를 지정해야 합니다. [Windows API for .NET..

    MoveToEx - 특정 시작점 이동

    MoveToEx함수는 그리기 위치의 시작점을 재설정하고 기존 위치값을 획득하는 함수입니다. Declare Function MoveToEx Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByRef lpPoint As POINTAPI) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int MoveToEx(int hdc, int x, int y, ref POINTAPI lpPoint); ▶C# 선언 MoveToEx함수의 첫번째 인수는 시작점을 설정할 Device Context를 지정해야 합니다. [Windows API for ..

    Rectangle - 사각형 그리기

    Rectangle함수는 지정된 Device Context에 사각형 모양의 그림을 그립니다. Declare Function Rectangle Lib "gdi32" Alias "Rectangle" (ByVal hdc As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int Rectangle(int hdc, int x1, int y1, int x2, int y2); ▶C# 선언 Rectangle의 첫번째 인수는 실제 사각형이 그려질 Object의 Device Context를 기..

    RoundRect - 모서리가 둥근 사각형 그리기

    RoundRect함수는 모서리가 둥근 사각형을 그리는 함수입니다. Declare Function RoundRect Lib "gdi32" Alias "RoundRect" (ByVal hdc As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer, ByVal x3 As Integer, ByVal y3 As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int RoundRect(int hdc, int x1, int y1, int x2, int y2, int x3, int y3); ▶C# 선언 RoundRect함수의..

    BitBlt - 지정된 영역을 Bitmap복사

    BitBlt함수는 인수로 지정된 해당 Device Context의 특정 영역을 Bitmap으로 복사하는 함수입니다. Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer ▶VB.NET 선언 [DllImport("gdi32")] public static extern int B..

    ShowCursor - Mouse Cursor의 숨김/해제

    ShowCursor함수는 전달된 인수에 따라 Mouse Cursor를 숨기거나 숨김을 해제하는 함수입니다. Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Boolean) As Integer ▶VB.NET 선언 ShowCursor(False/True) ▶VB.NET 호출 [DllImport("user32.dll")] public static extern int ShowCursor(bool bShow); ▶C# 선언 ShowCursor(false/true); ▶C# 호출 인수가 false이면 숨김, true이면 숨김해제 입니다. 또한 ShowCursor함수에 의해 Mouse Cursor가 숨겨진 상태라 하더라도 Mous..

    StretchBlt - 지정된 영역을 Bitmap복사

    StretchBlt함수는 지정된 Device Context영역을 Bitmap복사합니다. 이 기능은 BitBlt함수와 같지만 StretchBit함수는 복사된 Bitmap을 늘이거나 축소하고 좌우대칭을 바꾸는등의 추가적인 작업이 가능합니다. Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDc As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal nSrcWidth As In..