ImageAttributes.SetNoOp 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.
Renk ayarlamayı kapatır.
Aşırı Yüklemeler
| Name | Description |
|---|---|
| SetNoOp() |
Varsayılan kategori için renk ayarlamayı kapatır. Yöntemi çağırmadan ClearNoOp önce mevcut olan renk ayarlama ayarlarını yeniden devreye almak için SetNoOp yöntemini çağırabilirsiniz. |
| SetNoOp(ColorAdjustType) |
Belirtilen kategori için renk ayarlamayı kapatır. Yöntemi çağırmadan ClearNoOp önce mevcut olan renk ayarlama ayarlarını yeniden devreye almak için SetNoOp yöntemini çağırabilirsiniz. |
SetNoOp()
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
public:
void SetNoOp();
public void SetNoOp();
member this.SetNoOp : unit -> unit
Public Sub SetNoOp ()
Örnekler
Aşağıdaki kod örneği Windows Forms ile kullanılmak üzere tasarlanmıştır ve PaintEventArgs olay işleyicisinin bir parametresi olan ePaint gerektirir. Kod aşağıdaki eylemleri gerçekleştirir:
Camera.jpgdosyasını kullanan bir Image açar.
Nesnenin gama değerini ImageAttributes 0,25 olarak ayarlar.
Görüntüyü ekrana çizer.
SetNoOp yöntemini çağırır.
Görüntüyü (ikinci kamera) ekrana çizer; ancak yöntem SetNoOp çağrıldığından gama ayarı varsayılan olarak 1,0 değerine ayarlanır ve görüntü varsayılan gama ayarıyla ekrana çizilir.
Soldaki görüntünün çok yıkandığını (0,25 gama) ve sağdaki görüntünün daha fazla karşıtlık (gama 1,0) olduğunu unutmayın.
private:
void SetNoOpExample( PaintEventArgs^ e )
{
// Create an Image object from the file Camera.jpg.
Image^ myImage = Image::FromFile( "Camera.jpg" );
// Create an ImageAttributes object, and set the gamma to 0.25.
ImageAttributes^ imageAttr = gcnew ImageAttributes;
imageAttr->SetGamma( 0.25f );
// Draw the image with gamma set to 0.25.
Rectangle rect1 = Rectangle(20,20,200,200);
e->Graphics->DrawImage( myImage, rect1, 0, 0, 200, 200, GraphicsUnit::Pixel, imageAttr );
// Call the ImageAttributes NoOp method.
imageAttr->SetNoOp();
// Draw the image after NoOp is set, so the default gamma value
// of 1.0 will be used.
Rectangle rect2 = Rectangle(250,20,200,200);
e->Graphics->DrawImage( myImage, rect2, 0, 0, 200, 200, GraphicsUnit::Pixel, imageAttr );
}
private void SetNoOpExample(PaintEventArgs e)
{
// Create an Image object from the file Camera.jpg.
Image myImage = Image.FromFile("Camera.jpg");
// Create an ImageAttributes object, and set the gamma to 0.25.
ImageAttributes imageAttr = new ImageAttributes();
imageAttr.SetGamma(0.25f);
// Draw the image with gamma set to 0.25.
Rectangle rect1 = new Rectangle(20, 20, 200, 200);
e.Graphics.DrawImage(myImage, rect1, 0, 0, 200, 200,
GraphicsUnit.Pixel, imageAttr);
// Call the ImageAttributes NoOp method.
imageAttr.SetNoOp();
// Draw the image after NoOp is set, so the default gamma value
// of 1.0 will be used.
Rectangle rect2 = new Rectangle(250, 20, 200, 200);
e.Graphics.DrawImage(myImage, rect2, 0, 0, 200, 200,
GraphicsUnit.Pixel, imageAttr);
}
Public Sub SetNoOpExample(ByVal e As PaintEventArgs)
' Create an Image object from the file Camera.jpg.
Dim myImage As Image = Image.FromFile("Camera.jpg")
' Create an ImageAttributes object, and set the gamma to 0.25.
Dim imageAttr As New ImageAttributes
imageAttr.SetGamma(0.25F)
' Draw the image with gamma set to 0.25.
Dim rect1 As New Rectangle(20, 20, 200, 200)
e.Graphics.DrawImage(myImage, rect1, 0, 0, 200, 200, _
GraphicsUnit.Pixel, imageAttr)
' Call the ImageAttributes NoOp method.
imageAttr.SetNoOp()
' Draw the image with gamma set to 0.25, but now NoOp is set,
' so the uncorrected image will be shown.
Dim rect2 As New Rectangle(250, 20, 200, 200)
e.Graphics.DrawImage(myImage, rect2, 0, 0, 200, 200, _
GraphicsUnit.Pixel, imageAttr)
' Image
End Sub
Açıklamalar
Nesne ImageAttributes , beş ayarlama kategorisi için renk ve gri tonlama ayarlarını korur: varsayılan, bit eşlem, fırça, kalem ve metin. Örneğin, varsayılan kategori için bir gama değeri, bit eşlem kategorisi için farklı bir gama değeri ve kalem kategorisi için yine de farklı bir gama değeri belirtebilirsiniz.
Varsayılan renk ayarlama ve gri tonlamalı ayarlama ayarları, kendi ayarlama ayarları 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
SetNoOp(ColorAdjustType)
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
- Kaynak:
- ImageAttributes.cs
public:
void SetNoOp(System::Drawing::Imaging::ColorAdjustType type);
public void SetNoOp(System.Drawing.Imaging.ColorAdjustType type);
member this.SetNoOp : System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetNoOp (type As ColorAdjustType)
Parametreler
- type
- ColorAdjustType
Bunun öğesi ColorAdjustType , renk düzeltmesinin kapalı olduğu kategoriyi belirtir.
Örnekler
Kod örneği için yöntemine SetNoOp() bakın.
Açıklamalar
Nesne ImageAttributes , beş ayarlama kategorisi için renk ve gri tonlama ayarlarını korur: varsayılan, bit eşlem, fırça, kalem ve metin. Örneğin, varsayılan kategori için bir gama değeri, bit eşlem kategorisi için farklı bir gama değeri ve kalem kategorisi için yine de farklı bir gama değeri belirtebilirsiniz.