←选择平台

IntensityDetectEffect类

总结
通过过滤指定的图像来对图像应用二值分割,以检测指定强度范围内的颜色。
语法
c#
VB
c++
公共IntensityDetectEffect: ShaderEffect
公共IntensityDetectEffect继承了System.Windows.Media.Effects.ShaderEffect实现了System.Windows.Media.Animation.IAnimatable
公共ref类IntensityDetectEffect:公共System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatable
讲话

这个效果根据阈值将图像转换为黑白图像强度.值小于强度当值大于强度设置为白色。

例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing;使用Leadtools.Windows.Controls;使用Leadtools.Windows.Media;使用Leadtools.Windows.Media.Effects;IntensityDetectEffectExampleWindow:窗口公共IntensityDetectEffectExampleWindow ()StackPanel sp =StackPanel ();内容= sp;ImageViewer theViewer =imageview ();景观。水平Alignment = HorizontalAlignment.Center;景观。verticalalign = verticalalign . top;景观。imagehorizontalalign = horizontalalign . left;景观。imageverticalalign = verticalalign . top;sp.Children.Add(景观);//创建滑动条TextBlock tb =TextBlock ();结核病。horizontalalign = horizontalalign . center;结核病。文本=强度:“sp.Children.Add(结核病);滑动条=滑块();theSlider。最小值= 0.0;theSlider。最大值= 256.0;theSlider。宽度= 400;theSlider。方向=方向。水平;theSlider。IsSnapToTickEnabled =真正的theSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom right;theSlider。TickFrequency = 0.1;theSlider。AutoToolTipPrecision = 2;theSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom right;sp.Children.Add (theSlider);//加载图像到查看器景观。源=BitmapImage (Uri (System.IO.Path.Combine (LEAD_VARS.ImagesDir“Cannon.jpg”)));//创建效果IntensityDetectEffect effect =IntensityDetectEffect ();的效果。强度= 128.5;景观。ImageEffect =效果;//绑定属性绑定绑定=绑定();绑定。来源=效果;绑定。UpdateSourceTrigger = UpdateSourceTrigger. propertychanged;绑定。路径=PropertyPath (“强度”);theSlider.SetBinding(滑块。ValueProperty,绑定);Title =“使用IntensityDetectEffect”静态LEAD_VARS公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”
进口Leadtools进口Leadtools。编解码器进口Leadtools。ImageProcessing进口Leadtools.Windows.Controls进口Leadtools.Windows.Media进口Leadtools.Windows.Media.EffectsIntensityDetectEffectExampleWindow继承了窗口公共()昏暗的sp作为StackPanel ()内容= sp昏暗的景观作为imageview ()景观。水平Alignment = HorizontalAlignment.Center景观。VerticalAlignment = VerticalAlignment。前景观。ImageHorizontalAlignment = HorizontalAlignment。左景观。ImageVerticalAlignment =垂直对齐。前sp.Children.Add(景观)创建滑块昏暗的结核病作为TextBlock ()结核病。HorizontalAlignment = HorizontalAlignment。中心结核病。文本=强度:“sp.Children.Add (tb)昏暗的theSlider作为滑块()theSlider。最小值= 0.0theSlider。最大值= 256.0theSlider。宽度= 400theSlider。方向=方向。水平theSlider。IsSnapToTickEnabled =真正的theSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom righttheSlider。TickFrequency = 0.1theSlider。AutoToolTipPrecision = 2theSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom rightsp.Children.Add (theSlider)’将图像加载到查看器中景观。源=BitmapImage (Uri (System.IO.Path.Combine (LEAD_VARS.ImagesDir“Cannon.jpg”)))创造效果昏暗的效果作为IntensityDetectEffect ()的效果。强度= 128.5景观。ImageEffect =效果绑定属性昏暗的绑定作为绑定()绑定。来源=效果绑定。UpdateSourceTrigger = UpdateSourceTrigger。propertychange绑定。路径=PropertyPath (“强度”theSlider.SetBinding(滑块。ValueProperty绑定)Title =“使用IntensityDetectEffect”结束结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools.Windows.Media.Effects组装
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。