ImageAttributes.SetOutputChannel Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee stelt u het CMYK-uitvoerkanaal (cyaan-magenta-geel-zwart) in.
Overloads
| Name | Description |
|---|---|
| SetOutputChannel(ColorChannelFlag) |
Hiermee stelt u het CMYK-uitvoerkanaal (cyaan-magenta-geel-zwart) in voor de standaardcategorie. |
| SetOutputChannel(ColorChannelFlag, ColorAdjustType) |
Hiermee stelt u het CMYK-uitvoerkanaal (cyaan-magenta-geel-zwart) in voor een opgegeven categorie. |
SetOutputChannel(ColorChannelFlag)
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
Hiermee stelt u het CMYK-uitvoerkanaal (cyaan-magenta-geel-zwart) in voor de standaardcategorie.
public:
void SetOutputChannel(System::Drawing::Imaging::ColorChannelFlag flags);
public void SetOutputChannel(System.Drawing.Imaging.ColorChannelFlag flags);
member this.SetOutputChannel : System.Drawing.Imaging.ColorChannelFlag -> unit
Public Sub SetOutputChannel (flags As ColorChannelFlag)
Parameters
- flags
- ColorChannelFlag
Een element hiervan ColorChannelFlag geeft het uitvoerkanaal aan.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u de SetOutputChannel methode gebruikt. Als u dit voorbeeld wilt uitvoeren, plakt u de volgende code in een Windows Formulier. De gebeurtenis en oproep van Paint het formulier afhandelen, doorgeven ShowOutputChannels alsePaintEventArgs.
private void ShowOutputChannels(PaintEventArgs e)
{
//Create a bitmap from a file.
Bitmap bmp1 = new Bitmap("c:\\fakePhoto.jpg");
// Create a new bitmap from the original, resizing it for this example.
Bitmap bmp2 = new Bitmap(bmp1, new Size(80, 80));
bmp1.Dispose();
// Create an ImageAttributes object.
ImageAttributes imgAttributes = new ImageAttributes();
// Draw the image unaltered.
e.Graphics.DrawImage(bmp2, 10, 10);
// Draw the image, showing the intensity of the cyan channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC,
System.Drawing.Imaging.ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(100, 10, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the magenta channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM,
ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(10, 100, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the yellow channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY,
ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(100, 100, bmp2.Width, bmp2.Height), 0, 0,
bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the black channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK,
System.Drawing.Imaging.ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(10, 190, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
//Dispose of the bitmap.
bmp2.Dispose();
}
Private Sub ShowOutputChannels(ByVal e As PaintEventArgs)
'Create a bitmap from a file.
Dim bmp1 As New Bitmap("c:\fakePhoto.jpg")
' Create a new bitmap from the original, resizing it for this example.
Dim bmp2 As New Bitmap(bmp1, New Size(80, 80))
bmp1.Dispose()
' Create an ImageAttributes object.
Dim imgAttributes As New System.Drawing.Imaging.ImageAttributes()
' Draw the image unaltered.
e.Graphics.DrawImage(bmp2, 10, 10)
' Draw the image, showing the intensity of the cyan channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 10, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the magenta channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the yellow channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the black channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 190, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
'Dispose of the bitmap.
bmp2.Dispose()
End Sub
Opmerkingen
U kunt de SetOutputChannel methode gebruiken om een afbeelding te converteren naar een CMYK-kleurruimte en de intensiteit van een van de CMYK-kleurkanalen te onderzoeken. Stel dat u een ImageAttributes object maakt en het bitmapuitvoerkanaal instelt op ColorChannelC. Als u het pad van dat ImageAttributes object doorgeeft aan de DrawImage methode, wordt het cyaan onderdeel van elke pixel berekend en is elke pixel in de weergegeven afbeelding een grijstint die de intensiteit van het cyaan kanaal aangeeft. Op dezelfde manier kunt u afbeeldingen weergeven die de intensiteit van de magenta-, gele en zwarte kanalen aangeven.
Een ImageAttributes object onderhoudt instellingen voor kleur en grijswaarden voor vijf aanpassingscategorieën: standaard, bitmap, penseel, pen en tekst. U kunt bijvoorbeeld een uitvoerkanaal opgeven voor de standaardcategorie en een ander uitvoerkanaal voor de bitmapcategorie.
De standaardinstellingen voor kleuraanpassing en instellingen voor grijswaarden zijn van toepassing op alle categorieën die geen aanpassingsinstellingen hebben. Als u bijvoorbeeld nooit aanpassingsinstellingen voor de bitmapcategorie opgeeft, zijn de standaardinstellingen van toepassing op de bitmapcategorie.
Van toepassing op
SetOutputChannel(ColorChannelFlag, ColorAdjustType)
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
- Bron:
- ImageAttributes.cs
Hiermee stelt u het CMYK-uitvoerkanaal (cyaan-magenta-geel-zwart) in voor een opgegeven categorie.
public:
void SetOutputChannel(System::Drawing::Imaging::ColorChannelFlag flags, System::Drawing::Imaging::ColorAdjustType type);
public void SetOutputChannel(System.Drawing.Imaging.ColorChannelFlag flags, System.Drawing.Imaging.ColorAdjustType type);
member this.SetOutputChannel : System.Drawing.Imaging.ColorChannelFlag * System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetOutputChannel (flags As ColorChannelFlag, type As ColorAdjustType)
Parameters
- flags
- ColorChannelFlag
Een element hiervan ColorChannelFlag geeft het uitvoerkanaal aan.
- type
- ColorAdjustType
Een element hiervan ColorAdjustType geeft de categorie aan waarvoor het uitvoerkanaal is ingesteld.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u de SetOutputChannel methode gebruikt. Als u dit voorbeeld wilt uitvoeren, plakt u de volgende code in een Windows Formulier. De gebeurtenis en oproep van Paint het formulier afhandelen, doorgeven ShowOutputChannels alsePaintEventArgs.
private void ShowOutputChannels(PaintEventArgs e)
{
//Create a bitmap from a file.
Bitmap bmp1 = new Bitmap("c:\\fakePhoto.jpg");
// Create a new bitmap from the original, resizing it for this example.
Bitmap bmp2 = new Bitmap(bmp1, new Size(80, 80));
bmp1.Dispose();
// Create an ImageAttributes object.
ImageAttributes imgAttributes = new ImageAttributes();
// Draw the image unaltered.
e.Graphics.DrawImage(bmp2, 10, 10);
// Draw the image, showing the intensity of the cyan channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC,
System.Drawing.Imaging.ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(100, 10, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the magenta channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM,
ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(10, 100, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the yellow channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY,
ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(100, 100, bmp2.Width, bmp2.Height), 0, 0,
bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
// Draw the image, showing the intensity of the black channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK,
System.Drawing.Imaging.ColorAdjustType.Bitmap);
e.Graphics.DrawImage(bmp2, new Rectangle(10, 190, bmp2.Width, bmp2.Height),
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);
//Dispose of the bitmap.
bmp2.Dispose();
}
Private Sub ShowOutputChannels(ByVal e As PaintEventArgs)
'Create a bitmap from a file.
Dim bmp1 As New Bitmap("c:\fakePhoto.jpg")
' Create a new bitmap from the original, resizing it for this example.
Dim bmp2 As New Bitmap(bmp1, New Size(80, 80))
bmp1.Dispose()
' Create an ImageAttributes object.
Dim imgAttributes As New System.Drawing.Imaging.ImageAttributes()
' Draw the image unaltered.
e.Graphics.DrawImage(bmp2, 10, 10)
' Draw the image, showing the intensity of the cyan channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 10, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the magenta channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM, ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the yellow channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(100, 100, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
' Draw the image, showing the intensity of the black channel.
imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK, _
ColorAdjustType.Bitmap)
e.Graphics.DrawImage(bmp2, New Rectangle(10, 190, bmp2.Width, bmp2.Height), _
0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)
'Dispose of the bitmap.
bmp2.Dispose()
End Sub
Opmerkingen
U kunt de SetOutputChannel methode gebruiken om een afbeelding te converteren naar een CMYK-kleurruimte en de intensiteit van een van de CMYK-kleurkanalen te onderzoeken. Stel dat u een ImageAttributes object maakt en het bitmapuitvoerkanaal instelt op ColorChannelC. Als u het pad van dat ImageAttributes object doorgeeft aan de DrawImage methode, wordt het cyaan onderdeel van elke pixel berekend en is elke pixel in de weergegeven afbeelding een grijstint die de intensiteit van het cyaan kanaal aangeeft. Op dezelfde manier kunt u afbeeldingen weergeven die de intensiteit van de magenta-, gele en zwarte kanalen aangeven.
Een ImageAttributes object onderhoudt instellingen voor kleur en grijswaarden voor vijf aanpassingscategorieën: standaard, bitmap, penseel, pen en tekst. U kunt bijvoorbeeld een uitvoerkanaal opgeven voor de standaardcategorie en een ander uitvoerkanaal voor de bitmapcategorie.
De standaardinstellingen voor kleuraanpassing en instellingen voor grijswaarden zijn van toepassing op alle categorieën die geen aanpassingsinstellingen hebben. Als u bijvoorbeeld nooit aanpassingsinstellingen voor de bitmapcategorie opgeeft, zijn de standaardinstellingen van toepassing op de bitmapcategorie.
Zodra u een instelling voor kleuraanpassing of instelling voor grijswaarden voor een bepaalde categorie opgeeft, zijn de standaardinstellingen voor aanpassing niet meer van toepassing op die categorie. Stel dat u een verzameling aanpassingsinstellingen voor de standaardcategorie opgeeft. Als u het uitvoerkanaal voor de bitmapcategorie instelt door deze door te geven Bitmap aan de SetOutputChannel methode, zijn geen van de standaardinstellingen voor aanpassing van toepassing op bitmaps.