ImageAttributes.SetRemapTable Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Color-remap tablosunu ayarlar.
Aşırı Yüklemeler
SetRemapTable(ColorMap[]) |
Varsayılan kategori için color-remap tablosunu ayarlar. |
SetRemapTable(ReadOnlySpan<ColorMap>) | |
SetRemapTable(ReadOnlySpan<ValueTuple<Color,Color>>) | |
SetRemapTable(ColorAdjustType, ReadOnlySpan<ColorMap>) | |
SetRemapTable(ColorAdjustType, ReadOnlySpan<ValueTuple<Color,Color>>) | |
SetRemapTable(ColorMap[], ColorAdjustType) |
Belirtilen kategori için color-remap tablosunu ayarlar. |
SetRemapTable(ColorMap[])
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
Varsayılan kategori için color-remap tablosunu ayarlar.
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())
Parametreler
- map
- ColorMap[]
türünde ColorMaprenk çiftleri dizisi. Her renk çifti, var olan bir rengi (ilk değer) ve eşleştirileceği rengi (ikinci değer) içerir.
Örnekler
Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin Paint bir parametresi olan gerektirir.PaintEventArgse
Kod aşağıdaki eylemleri gerçekleştirir:
Bir resim (kırmızı daire) oluşturur, Circle2.jpg olarak kaydeder, bu görüntüyü açar ve ekrana çizer.
Kırmızı rengi yeşil renkle eşleyen bir renk haritası oluşturur.
Daha önce oluşturulan görüntüyü yeniden ekrana çizer, ancak bu kez renk haritasını kullanır.
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
Açıklamalar
Renk yeniden eşleme tablosu bir yapı dizisidir ColorMap . Her ColorMap yapıda iki Color nesne vardır: biri eski bir rengi, diğeri de buna karşılık gelen yeni rengi belirtir. İşleme sırasında, yeniden eşleme tablosundaki eski renklerden biriyle eşleşen tüm renkler ilgili yeni renge değiştirilir.
Nesne ImageAttributes beş ayar kategorisi için renk ve gri tonlamalı ayarları korur: varsayılan, bit eşlem, fırça, kalem ve metin. Örneğin, varsayılan kategori için bir renk yeniden eşlemesi, bit eşlem kategorisi için bir renk yeniden eşleme tablosu ve kalem kategorisi için farklı bir renk yeniden eşleme tablosu belirtebilirsiniz.
Varsayılan renk ayarlama ve gri tonlamalı ayarlama ayarları, kendi ayarlama ayarlarına sahip olmayan tüm kategoriler için geçerlidir. Örneğin, kalem kategorisi için hiçbir ayarlama ayarı belirtmezseniz, varsayılan ayarlar kalem kategorisine uygulanır.
Şunlara uygulanır
SetRemapTable(ReadOnlySpan<ColorMap>)
- Kaynak:
- 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))
Parametreler
- map
- ReadOnlySpan<ColorMap>
Şunlara uygulanır
SetRemapTable(ReadOnlySpan<ValueTuple<Color,Color>>)
- Kaynak:
- 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)))
Parametreler
- map
- ReadOnlySpan<ValueTuple<Color,Color>>
Şunlara uygulanır
SetRemapTable(ColorAdjustType, ReadOnlySpan<ColorMap>)
- Kaynak:
- 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))
Parametreler
- type
- ColorAdjustType
- map
- ReadOnlySpan<ColorMap>
Şunlara uygulanır
SetRemapTable(ColorAdjustType, ReadOnlySpan<ValueTuple<Color,Color>>)
- Kaynak:
- 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)))
Parametreler
- type
- ColorAdjustType
- map
- ReadOnlySpan<ValueTuple<Color,Color>>
Şunlara uygulanır
SetRemapTable(ColorMap[], ColorAdjustType)
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
Belirtilen kategori için color-remap tablosunu ayarlar.
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)
Parametreler
- map
- ColorMap[]
türünde ColorMaprenk çiftleri dizisi. Her renk çifti, var olan bir rengi (ilk değer) ve eşleştirileceği rengi (ikinci değer) içerir.
- type
- ColorAdjustType
Color-remap tablosunun ayarlandığı kategoriyi belirten öğesi ColorAdjustType .
Örnekler
Kod örneği için yöntemine SetRemapTable(ColorMap[]) bakın.
Açıklamalar
Renk yeniden eşleme tablosu bir yapı dizisidir ColorMap . Her ColorMap yapıda iki Color nesne vardır: biri eski bir rengi, diğeri de buna karşılık gelen yeni rengi belirtir. İşleme sırasında, yeniden eşleme tablosundaki eski renklerden biriyle eşleşen tüm renkler ilgili yeni renge değiştirilir.
Nesne ImageAttributes beş ayar kategorisi için renk ve gri tonlamalı ayarları korur: varsayılan, bit eşlem, fırça, kalem ve metin. Örneğin, varsayılan kategori için bir renk yeniden eşlemesi, bit eşlem kategorisi için bir renk yeniden eşleme tablosu ve kalem kategorisi için farklı bir renk yeniden eşleme tablosu belirtebilirsiniz.
Varsayılan renk ayarlama ve gri tonlamalı ayarlama ayarları, kendi ayarlama ayarlarına sahip olmayan tüm kategoriler için geçerlidir. Örneğin, kalem kategorisi için hiçbir ayarlama ayarı belirtmezseniz, varsayılan ayarlar kalem kategorisine uygulanır.
Belirli bir kategori için renk ayarlama veya gri tonlamalı ayarlama ayarı belirttiğiniz anda, varsayılan ayarlama ayarları artık bu kategori için geçerli değildir. Örneğin, varsayılan kategori için bir ayarlama ayarları koleksiyonu belirttiğinizi varsayalım. Kalem kategorisi için color-remap tablosunu yöntemine SetRemapTable geçirerek Pen ayarlarsanız, varsayılan ayarlama ayarlarının hiçbiri kalemlere uygulanmaz.
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin