本文整理汇总了C#中System.Drawing.Imaging.ImageAttributes.SetColorMatrices方法的典型用法代码示例。如果您正苦于以下问题:C# ImageAttributes.SetColorMatrices方法的具体用法?C# ImageAttributes.SetColorMatrices怎么用?C# ImageAttributes.SetColorMatrices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Imaging.ImageAttributes
的用法示例。
在下文中一共展示了ImageAttributes.SetColorMatrices方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetColorMatrices_InvalidFlags
public void SetColorMatrices_InvalidFlags ()
{
using (ImageAttributes ia = new ImageAttributes ()) {
ia.SetColorMatrices (global_color_matrix, global_color_matrix, (ColorMatrixFlag) Int32.MinValue);
}
}
示例2: SetColorMatrices_InvalidType
public void SetColorMatrices_InvalidType ()
{
using (ImageAttributes ia = new ImageAttributes ()) {
ia.SetColorMatrices (global_color_matrix, global_color_matrix, ColorMatrixFlag.Default, (ColorAdjustType) Int32.MinValue);
}
}
示例3: SetColorMatrices_ColorMatrix_ColorMatrix
public void SetColorMatrices_ColorMatrix_ColorMatrix ()
{
using (ImageAttributes ia = new ImageAttributes ()) {
ia.SetColorMatrices (global_color_matrix, global_color_matrix);
ia.SetColorMatrices (global_color_matrix, global_color_matrix, ColorMatrixFlag.Default);
ia.SetColorMatrices (global_color_matrix, global_color_matrix, ColorMatrixFlag.SkipGrays);
ia.SetColorMatrices (global_color_matrix, global_color_matrix, ColorMatrixFlag.AltGrays);
}
}
示例4: SetColorMatrices_ColorMatrix_Null_AltGrays
public void SetColorMatrices_ColorMatrix_Null_AltGrays ()
{
using (ImageAttributes ia = new ImageAttributes ()) {
ia.SetColorMatrices (global_color_matrix, null, ColorMatrixFlag.AltGrays);
}
}
示例5: SetColorMatrices_Null_ColorMatrix
public void SetColorMatrices_Null_ColorMatrix ()
{
using (ImageAttributes ia = new ImageAttributes ()) {
ia.SetColorMatrices (null, global_color_matrix);
}
}
示例6: ProcessColorMatrices
private static Color ProcessColorMatrices (Color color, ColorMatrix colorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag flags, ColorAdjustType type)
{
using (Bitmap bmp = new Bitmap (64, 64)) {
using (Graphics gr = Graphics.FromImage (bmp)) {
ImageAttributes imageAttr = new ImageAttributes ();
bmp.SetPixel (0, 0, color);
imageAttr.SetColorMatrices (colorMatrix, grayMatrix, flags, type);
gr.DrawImage (bmp, new Rectangle (0, 0, 64, 64), 0, 0, 64, 64, GraphicsUnit.Pixel, imageAttr);
return bmp.GetPixel (0, 0);
}
}
}
示例7: AddColourizer
new float[] {-0.5f, -0.5f, .8f, 0, 1}}; // three translations of 0.2
#endregion Fields
#region Methods
public static void AddColourizer(ImageAttributes toia, Color usecolor)
{
ColorMatrix grayscaler = GrayScale();
toia.SetColorMatrices(GetColourizer(usecolor), grayscaler);
}