ImageAttributes.SetRemapTable 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
색 매핑 변경 테이블을 설정합니다.
오버로드
SetRemapTable(ColorMap[])
- Source:
- ImageAttributes.cs
- Source:
- ImageAttributes.cs
- Source:
- ImageAttributes.cs
기본 범주에 대한 색 다시 매핑 테이블을 설정합니다.
public:
void SetRemapTable(cli::array <System::Drawing::Imaging::ColorMap ^> ^ map);
public:
void SetRemapTable(... cli::array <System::Drawing::Imaging::ColorMap ^> ^ map);
public void SetRemapTable (System.Drawing.Imaging.ColorMap[] map);
public void SetRemapTable (params System.Drawing.Imaging.ColorMap[] map);
member this.SetRemapTable : System.Drawing.Imaging.ColorMap[] -> unit
Public Sub SetRemapTable (map As ColorMap())
Public Sub SetRemapTable (ParamArray map As ColorMap())
매개 변수
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
이미지(빨간색 원)를 만들고, Circle2.jpg 저장하고, 해당 이미지를 열고, 화면에 그립니다.
빨간색을 녹색에 매핑하는 색 맵을 만듭니다.
이전에 만든 이미지를 화면에 다시 그립니다. 이번에는 색 맵을 사용하여 그립니다.
private:
void SetRemapTableExample( PaintEventArgs^ e )
{
// Create a filled, red image, and save it to Circle2.jpg.
Bitmap^ myBitmap = gcnew Bitmap( 50,50 );
Graphics^ g = Graphics::FromImage( myBitmap );
g->Clear( Color::White );
g->FillEllipse( gcnew SolidBrush( Color::Red ), Rectangle(0,0,50,50) );
myBitmap->Save( "Circle2.jpg" );
// Create an Image object from the Circle2.jpg file, and draw it to
// the screen.
Image^ myImage = Image::FromFile( "Circle2.jpg" );
e->Graphics->DrawImage( myImage, 20, 20 );
// Create a color map.
array<ColorMap^>^myColorMap = gcnew array<ColorMap^>(1);
myColorMap[ 0 ] = gcnew ColorMap;
myColorMap[ 0 ]->OldColor = Color::Red;
myColorMap[ 0 ]->NewColor = Color::Green;
// Create an ImageAttributes object, and then pass the
// myColorMap object to the SetRemapTable method.
ImageAttributes^ imageAttr = gcnew ImageAttributes;
imageAttr->SetRemapTable( myColorMap );
// Draw the image with the remap table set.
Rectangle rect = Rectangle(150,20,50,50);
e->Graphics->DrawImage( myImage, rect, 0, 0, 50, 50, GraphicsUnit::Pixel, imageAttr );
}
private void SetRemapTableExample(PaintEventArgs e)
{
// Create a filled, red image, and save it to Circle2.jpg.
Bitmap myBitmap = new Bitmap(50, 50);
Graphics g = Graphics.FromImage(myBitmap);
g.Clear(Color.White);
g.FillEllipse(new SolidBrush(Color.Red),
new Rectangle(0, 0, 50, 50));
myBitmap.Save("Circle2.jpg");
// Create an Image object from the Circle2.jpg file, and draw it to
// the screen.
Image myImage = Image.FromFile("Circle2.jpg");
e.Graphics.DrawImage(myImage, 20, 20);
// Create a color map.
ColorMap[] myColorMap = new ColorMap[1];
myColorMap[0] = new ColorMap();
myColorMap[0].OldColor = Color.Red;
myColorMap[0].NewColor = Color.Green;
// Create an ImageAttributes object, and then pass the
// myColorMap object to the SetRemapTable method.
ImageAttributes imageAttr = new ImageAttributes();
imageAttr.SetRemapTable(myColorMap);
// Draw the image with the remap table set.
Rectangle rect = new Rectangle(150, 20, 50, 50);
e.Graphics.DrawImage(myImage, rect, 0, 0, 50, 50,
GraphicsUnit.Pixel, imageAttr);
}
Public Sub SetRemapTableExample(ByVal e As PaintEventArgs)
' Create a filled, red image and save it to Circle2.jpg.
Dim myBitmap As New Bitmap(50, 50)
Dim g As Graphics = Graphics.FromImage(myBitmap)
g.Clear(Color.White)
g.FillEllipse(New SolidBrush(Color.Red), New Rectangle(0, 0, _
50, 50))
myBitmap.Save("Circle2.jpg")
' Create an Image object from the Circle2.jpg file, and draw
' it to the screen.
Dim myImage As Image = Image.FromFile("Circle2.jpg")
e.Graphics.DrawImage(myImage, 20, 20)
' Create a color map.
Dim myColorMap(0) As ColorMap
myColorMap(0) = New ColorMap
myColorMap(0).OldColor = Color.Red
myColorMap(0).NewColor = Color.Green
' Create an ImageAttributes object, and then pass the
' myColorMap object to the SetRemapTable method.
Dim imageAttr As New ImageAttributes
imageAttr.SetRemapTable(myColorMap)
' Draw the image with the remap table set.
Dim rect As New Rectangle(150, 20, 50, 50)
e.Graphics.DrawImage(myImage, rect, 0, 0, 50, 50, _
GraphicsUnit.Pixel, imageAttr)
' Image
End Sub
설명
색 다시 매핑 테이블은 구조체의 ColorMap 배열입니다. 각 ColorMap 구조체에는 이전 색을 지정하는 개체와 해당하는 새 색을 지정하는 개체가 있습니다 Color . 렌더링하는 동안 다시 매핑 테이블의 이전 색 중 하나와 일치하는 모든 색이 해당 새 색으로 변경됩니다.
개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대한 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주에 대한 색 다시 매핑, 비트맵 범주에 대한 색 다시 매핑 테이블 및 펜 범주에 대한 다른 색 다시 매핑 테이블을 지정할 수 있습니다.
기본 색 조정 및 회색조 조정 설정은 자체 조정 설정이 없는 모든 범주에 적용됩니다. 예를 들어 펜 범주에 대한 조정 설정을 지정하지 않으면 기본 설정이 펜 범주에 적용됩니다.
적용 대상
SetRemapTable(ReadOnlySpan<ColorMap>)
- Source:
- ImageAttributes.cs
public:
void SetRemapTable(ReadOnlySpan<System::Drawing::Imaging::ColorMap ^> map);
public void SetRemapTable (ReadOnlySpan<System.Drawing.Imaging.ColorMap> map);
member this.SetRemapTable : ReadOnlySpan<System.Drawing.Imaging.ColorMap> -> unit
Public Sub SetRemapTable (map As ReadOnlySpan(Of ColorMap))
매개 변수
- map
- ReadOnlySpan<ColorMap>
적용 대상
SetRemapTable(ReadOnlySpan<ValueTuple<Color,Color>>)
- Source:
- ImageAttributes.cs
public:
void SetRemapTable(ReadOnlySpan<ValueTuple<System::Drawing::Color, System::Drawing::Color>> map);
public void SetRemapTable (ReadOnlySpan<(System.Drawing.Color OldColor, System.Drawing.Color NewColor)> map);
member this.SetRemapTable : ReadOnlySpan<ValueTuple<System.Drawing.Color, System.Drawing.Color>> -> unit
Public Sub SetRemapTable (map As ReadOnlySpan(Of ValueTuple(Of Color, Color)))
매개 변수
- map
- ReadOnlySpan<ValueTuple<Color,Color>>
적용 대상
SetRemapTable(ColorAdjustType, ReadOnlySpan<ColorMap>)
- Source:
- ImageAttributes.cs
public:
void SetRemapTable(System::Drawing::Imaging::ColorAdjustType type, ReadOnlySpan<System::Drawing::Imaging::ColorMap ^> map);
public void SetRemapTable (System.Drawing.Imaging.ColorAdjustType type, ReadOnlySpan<System.Drawing.Imaging.ColorMap> map);
member this.SetRemapTable : System.Drawing.Imaging.ColorAdjustType * ReadOnlySpan<System.Drawing.Imaging.ColorMap> -> unit
Public Sub SetRemapTable (type As ColorAdjustType, map As ReadOnlySpan(Of ColorMap))
매개 변수
- type
- ColorAdjustType
- map
- ReadOnlySpan<ColorMap>
적용 대상
SetRemapTable(ColorAdjustType, ReadOnlySpan<ValueTuple<Color,Color>>)
- Source:
- ImageAttributes.cs
public:
void SetRemapTable(System::Drawing::Imaging::ColorAdjustType type, ReadOnlySpan<ValueTuple<System::Drawing::Color, System::Drawing::Color>> map);
public void SetRemapTable (System.Drawing.Imaging.ColorAdjustType type, ReadOnlySpan<(System.Drawing.Color OldColor, System.Drawing.Color NewColor)> map);
member this.SetRemapTable : System.Drawing.Imaging.ColorAdjustType * ReadOnlySpan<ValueTuple<System.Drawing.Color, System.Drawing.Color>> -> unit
Public Sub SetRemapTable (type As ColorAdjustType, map As ReadOnlySpan(Of ValueTuple(Of Color, Color)))
매개 변수
- type
- ColorAdjustType
- map
- ReadOnlySpan<ValueTuple<Color,Color>>
적용 대상
SetRemapTable(ColorMap[], ColorAdjustType)
- Source:
- ImageAttributes.cs
- Source:
- ImageAttributes.cs
- Source:
- ImageAttributes.cs
지정된 범주에 대한 색 매핑 변경 테이블을 설정합니다.
public:
void SetRemapTable(cli::array <System::Drawing::Imaging::ColorMap ^> ^ map, System::Drawing::Imaging::ColorAdjustType type);
public void SetRemapTable (System.Drawing.Imaging.ColorMap[] map, System.Drawing.Imaging.ColorAdjustType type);
member this.SetRemapTable : System.Drawing.Imaging.ColorMap[] * System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetRemapTable (map As ColorMap(), type As ColorAdjustType)
매개 변수
- type
- ColorAdjustType
색 매핑 변경 테이블이 설정되는 범주를 지정하는 ColorAdjustType의 요소입니다.
예제
코드 예제는 메서드를 참조하세요 SetRemapTable(ColorMap[]) .
설명
색 다시 매핑 테이블은 구조체의 ColorMap 배열입니다. 각 ColorMap 구조체에는 이전 색을 지정하는 개체와 해당하는 새 색을 지정하는 개체가 있습니다 Color . 렌더링하는 동안 다시 매핑 테이블의 이전 색 중 하나와 일치하는 모든 색이 해당 새 색으로 변경됩니다.
개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대한 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주에 대한 색 다시 매핑, 비트맵 범주에 대한 색 다시 매핑 테이블 및 펜 범주에 대한 다른 색 다시 매핑 테이블을 지정할 수 있습니다.
기본 색 조정 및 회색조 조정 설정은 자체 조정 설정이 없는 모든 범주에 적용됩니다. 예를 들어 펜 범주에 대한 조정 설정을 지정하지 않으면 기본 설정이 펜 범주에 적용됩니다.
특정 범주에 대한 색 조정 또는 회색조 조정 설정을 지정하는 즉시 기본 조정 설정이 해당 범주에 더 이상 적용되지 않습니다. 예를 들어 기본 범주에 대한 조정 설정 컬렉션을 지정한다고 가정합니다. 메서드에 전달 PenSetRemapTable 하여 펜 범주에 대한 색 다시 매핑 테이블을 설정하는 경우 펜에 기본 조정 설정이 적용되지 않습니다.
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기