-
源码中包含了图像特效滤镜应用,具备灰度和亮度调节功能
资源介绍
private void btnApply12_Click(object sender, EventArgs e)
{
if (cmbBox12.SelectedIndex == -1)
{
MessageBox.Show("请选择图像特效滤镜!");
return;
}
//释放图像引擎当前滤镜组,如果希望叠加多个滤镜的效果,则不需要清理,依次加入想要应用的滤镜特效即可
//本引擎会自动按照添加的先后顺序对原始图片应用滤镜特效
engine.Effects.Clear();
//释放资源
if (pictureBox2.Image != null)
{
pictureBox2.Image.Dispose();
pictureBox2.Image = null;
}
//重新加载图像
LoadImage();
#region 根据选择的滤镜类型,应用滤镜到图像引擎
switch (cmbBox12.SelectedIndex)
{
case 0:
{
#region 亮度调整
AdjustBrightnessEffect effect = new AdjustBrightnessEffect();
effect.Level = 100;
engine.Effects.Clear();
engine.Effects.Add(effect);
pictureBox2.Image = engine.GetOutputImage();
#endregion
}
break;
case 1:
{
#region 对比度调整
AdjustContrastEffect effect = new AdjustContrastEffect();
effect.Level = 100;
engine.Effects.Clear();
engine.Effects.Add(effect);
pictureBox2.Image = engine.GetOutputImage();
#endregion
}
break;
case 2:
{
#region gamma调整
AdjustGammaEffect effect = new AdjustGammaEffect();
effect.Gamma = 10;
engine.Effects.Clear();
engine.Effects.Add(effect);
pictureBox2.Image = engine.GetOutputImage();
#endregion
- 上一篇: matlab用卷积神经网络实现彩色图像的超分辨率matlab.zip
- 下一篇: 超好用截图录屏工具