小白实习,求大神指导,急!!!!! bmp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //gamma值是用曲线表示的,这是一种人的眼睛对光的一种感应曲线,其中包括了物理量、身理感官及心理的感知度 /**//// <summary> /// Gamma校正 /// </summary> /// <param name="bmp">输入Bitmap</param> /// <param name="val">[0 <-明- 1 -暗-> 2]</param> /// <returns>输出Bitmap</returns> public static Bitmap KiGamma(Bitmap bmp, float val) { if (bmp == null) { return null; } // 1表示无变化,就不做 if (val == 1.0000f) return bmp; try { Bitmap b = new Bitmap(bmp.Width, bmp.Height); Graphics g = Graphics.FromImage(b); ImageAttributes attr = new ImageAttributes(); attr.SetGamma(val, ColorAdjustType.Bitmap); g.DrawImage(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attr); g.Dispose(); return b; } catch { return null; } } 我是想通过调节3个分别代表红绿蓝的hscrollbar来调整图像,我想知道hscrollbar事件怎么写,大神能指导下吗 wcf用.svc发布在iis中的问题 如果用C#实现多台电脑能共享一台电脑的桌面? C#创建一个数据库 sql CASE 语法的问题:表达式代表什么意思 双击窗体标题栏,使整个窗体缩成只剩下标题栏 界面设计 问问各位,在没有.net环境下,怎么运行debug下的c#应用程序? dataGridView 怎么用BinaryReader的ReadString()方法把客户端数据读完? runat="server"的复选框控件,可以用客户端编程吗? web程序抓取页面的html代码,页面带有js输出内容 C#有关编译原理
/**//// <summary>
/// Gamma校正
/// </summary>
/// <param name="bmp">输入Bitmap</param>
/// <param name="val">[0 <-明- 1 -暗-> 2]</param>
/// <returns>输出Bitmap</returns>
public static Bitmap KiGamma(Bitmap bmp, float val)
{
if (bmp == null)
{
return null;
} // 1表示无变化,就不做
if (val == 1.0000f) return bmp; try
{
Bitmap b = new Bitmap(bmp.Width, bmp.Height);
Graphics g = Graphics.FromImage(b);
ImageAttributes attr = new ImageAttributes(); attr.SetGamma(val, ColorAdjustType.Bitmap);
g.DrawImage(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attr);
g.Dispose();
return b;
}
catch
{
return null;
}
}