AdjustContrast

RasterImage.AdjustContrast method

图像对比

public virtual void AdjustContrast(float contrast)
范围类型描述
contrastSingle对比度值(范围 [-100; 100])

例子

以下示例执行图像的对比度校正。

[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
    Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;

    // 设置对比度值。可接受的对比度值在 [-100f, 100f] 范围内。
    rasterImage.AdjustContrast(50);
    rasterImage.Save(dir + "sample.AdjustContrast.png");
}

也可以看看