ColorTranslator.FromWin32(Int32) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Windows 색상 값을 GDI+ Color 구조체로 변환합니다.
public:
static System::Drawing::Color FromWin32(int win32Color);
public static System.Drawing.Color FromWin32 (int win32Color);
static member FromWin32 : int -> System.Drawing.Color
Public Shared Function FromWin32 (win32Color As Integer) As Color
매개 변수
- win32Color
- Int32
변환할 Windows 색입니다.
반환
변환된 Windows 색을 나타내는 Color 구조체를 반환합니다.
예제
다음 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 Windows 색 값을 구조체로 Color 변환한 다음 해당 색을 사용하여 사각형을 채웁니다.
public:
void FromWin32_Example( PaintEventArgs^ e )
{
// Create an integer representation of a Windows color.
int winColor = 0xA000;
// Translate winColor to a GDI+ Color structure.
Color myColor = ColorTranslator::FromWin32( winColor );
// Fill a rectangle with myColor.
e->Graphics->FillRectangle( gcnew SolidBrush( myColor ), 0, 0, 100, 100 );
}
public void FromWin32_Example(PaintEventArgs e)
{
// Create an integer representation of a Windows color.
int winColor = 0xA000;
// Translate winColor to a GDI+ Color structure.
Color myColor = ColorTranslator.FromWin32(winColor);
// Fill a rectangle with myColor.
e.Graphics.FillRectangle( new SolidBrush(myColor), 0, 0,
100, 100);
}
Public Sub FromWin32_Example(ByVal e As PaintEventArgs)
' Create an integer representation of a Win32 color.
Dim winColor As Integer = &HA000
' Translate winColor to a GDI+ Color structure.
Dim myColor As Color = ColorTranslator.FromWin32(winColor)
' Fill a rectangle with myColor.
e.Graphics.FillRectangle(New SolidBrush(myColor), 0, 0, 100, 100)
End Sub
적용 대상
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기