←选择平台

WindowLevelEffect类

总结
在指定图像上填充并应用窗口水平。
语法
c#
VB
c++
公共WindowLevelEffect: ShaderEffect
公共WindowLevelEffect继承了System.Windows.Media.Effects.ShaderEffect实现了System.Windows.Media.Animation.IAnimatable
公共ref类WindowLevelEffect:公共System.Windows.Media.Effects.ShaderEffect,System.Windows.Media.Animation.IAnimatable
讲话

提供“按需”窗口调平效果,不改变图像数据。

要了解有关窗口调平的更多信息,请参阅RasterImage。WindowLevelRasterImage。WindowLevelExtWindowLevelCommandLeadtools.ImageProcessing.Core.WindowLevelExtCommand保存窗口级别的图像,改变亮度和对比度

例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing;使用Leadtools.Windows.Controls;使用Leadtools.Windows.Media;使用Leadtools.Windows.Media.Effects;WindowLevelEffectExampleWindow:窗口公共WindowLevelEffectExampleWindow ()StackPanel sp =StackPanel ();内容= sp;RasterImageViewer theViewer =RasterImageViewer ();景观。水平Alignment = HorizontalAlignment.Center;景观。verticalalign = verticalalign . top;景观。imagehorizontalalign = horizontalalign . left;景观。imageverticalalign = verticalalign . top;sp.Children.Add(景观);//加载图像到查看器使用(RasterCodecs codecs =RasterCodecs ())景观。Image = codecs.Load(System.IO.Path.Combine(LEAD_VARS.ImagesDir,“Image3.dcm”));//创建滑动条TextBlock tb =TextBlock ();结核病。horizontalalign = horizontalalign . center;结核病。文本=“窗口宽度:”sp.Children.Add(结核病);滑动条windowWidthSlider =滑块();windowWidthSlider。最小值= 0.0;windowWidthSlider。最大值=数学。Pow(2, theViewer.Image.BitsPerPixel - 1);windowWidthSlider。宽度= 400;windowWidthSlider。方向=方向。水平;windowWidthSlider。IsSnapToTickEnabled =真正的windowWidthSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom right;windowWidthSlider。TickFrequency = 0.1;windowWidthSlider。AutoToolTipPrecision = 2;windowWidthSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom right;sp.Children.Add (windowWidthSlider);结核病=TextBlock ();结核病。horizontalalign = horizontalalign . center;结核病。文本=“窗口中心:”sp.Children.Add(结核病);滑块windowCenterSlider =滑块();windowCenterSlider。最小值= 0.0;windowCenterSlider。最大值=数学。Pow(2, theViewer.Image.BitsPerPixel - 1);windowCenterSlider。宽度= 400;windowCenterSlider。方向=方向。水平;windowCenterSlider。IsSnapToTickEnabled =真正的windowCenterSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom right;windowCenterSlider。TickFrequency = 0.1;windowCenterSlider。AutoToolTipPrecision = 2;windowCenterSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom right;sp.Children.Add (windowCenterSlider);//设置效果WindowLevelEffect效果=WindowLevelEffect ();//设置纹理effect.FillGrayTexture (theViewer.Image);的效果。开始= Colors.Black;的效果。结束=颜色。白色;的效果。CurveType = CurveType. linear;的效果。因子= 0.0;的效果。窗口Width = Math.Pow(2, theViewer.Image.MaxValue - theViewer.Image.MinValue);的效果。窗口中心=的效果。窗口Width / 2;景观。ImageEffect =效果;//绑定属性绑定绑定=绑定();绑定。来源=效果;绑定。UpdateSourceTrigger = UpdateSourceTrigger. propertychanged;绑定。路径=PropertyPath (“WindowWidth”);windowWidthSlider.SetBinding(滑块。ValueProperty,绑定);绑定=绑定();绑定。来源=效果;绑定。UpdateSourceTrigger = UpdateSourceTrigger. propertychanged;绑定。路径=PropertyPath (“WindowCenter”);windowCenterSlider.SetBinding(滑块。ValueProperty,绑定);Title =“使用WindowLevelEffect”静态LEAD_VARS公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”
进口Leadtools进口Leadtools。编解码器进口Leadtools。ImageProcessing进口Leadtools.Windows.Controls进口Leadtools.Windows.Media进口Leadtools.Windows.Media.EffectsWindowLevelEffectExampleWindow继承了窗口公共()昏暗的sp作为StackPanel ()内容= sp昏暗的景观作为RasterImageViewer ()景观。水平Alignment = HorizontalAlignment.Center景观。VerticalAlignment = VerticalAlignment。前景观。ImageHorizontalAlignment = HorizontalAlignment。左景观。ImageVerticalAlignment =垂直对齐。前sp.Children.Add(景观)’将图像加载到查看器中使用编解码器作为RasterCodecs ()景观。Image = codecs.Load(System.IO.Path.Combine(LEAD_VARS.ImagesDir,“Image3.dcm”))结束使用创建滑块昏暗的结核病作为TextBlock ()结核病。HorizontalAlignment = HorizontalAlignment。中心结核病。文本=“窗口宽度:”sp.Children.Add (tb)昏暗的windowWidthSlider作为滑块()windowWidthSlider。最小值= 0.0windowWidthSlider。最大值=数学。Pow(2, theViewer.Image.BitsPerPixel - 1)windowWidthSlider。宽度= 400windowWidthSlider。方向=方向。水平windowWidthSlider。IsSnapToTickEnabled =真正的windowWidthSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom rightwindowWidthSlider。TickFrequency = 0.1windowWidthSlider。AutoToolTipPrecision = 2windowWidthSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom rightsp.Children.Add (windowWidthSlider)结核病=TextBlock ()结核病。HorizontalAlignment = HorizontalAlignment。中心结核病。文本=“窗口中心:”sp.Children.Add (tb)昏暗的windowCenterSlider作为滑块()windowCenterSlider。最小值= 0.0windowCenterSlider。最大值=数学。Pow(2, theViewer.Image.BitsPerPixel - 1)windowCenterSlider。宽度= 400windowCenterSlider。方向=方向。水平windowCenterSlider。IsSnapToTickEnabled =真正的windowCenterSlider。TickPlacement = system . windows . controls . primitives . tickplace . bottom rightwindowCenterSlider。TickFrequency = 0.1windowCenterSlider。AutoToolTipPrecision = 2windowCenterSlider。AutoToolTipPlacement = system . windows . controls . primitives . autotooltipplace . bottom rightsp.Children.Add (windowCenterSlider)设置效果昏暗的效果作为WindowLevelEffect ()设置纹理effect.FillGrayTexture (theViewer.Image)的效果。开始=颜色。黑色的的效果。结束=颜色。白色的效果。CurveType =曲线类型。线性的效果。因子= 0.0的效果。窗口Width = Math.Pow(2, theViewer.Image.MaxValue - theViewer.Image.MinValue)的效果。窗口中心=的效果。窗口Width / 2景观。ImageEffect =效果绑定属性昏暗的绑定作为绑定()绑定。来源=效果绑定。UpdateSourceTrigger = UpdateSourceTrigger。propertychange绑定。路径=PropertyPath (“WindowWidth”windowWidthSlider.SetBinding(滑块。ValueProperty绑定)绑定=绑定()绑定。来源=效果绑定。UpdateSourceTrigger = UpdateSourceTrigger。propertychange绑定。路径=PropertyPath (“WindowCenter”windowCenterSlider.SetBinding(滑块。ValueProperty绑定)Title =“使用WindowLevelEffect”结束结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

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