公共类CombineFastCommand:RasterCommand
公共类CombineFastCommand
继承了RasterCommand
@接口LTCombineFastCommand: LTRasterCommand
公共类CombineFastCommand扩展RasterCommand
公共ref类CombineFastCommand:公共RasterCommand
作为一个例子,假设您使用SpatialFilterCommand类应用边缘检测过滤器。然后,您可以使用这个类将生成的图像与原始图像结合起来,以生成具有硬边的图像。
类中的图像进行组合DestinationImage属性使用传递给运行方法。的DestinationImage将保存合并操作的结果。
CombineFastCommand标志分为四组:源(SRC)标志、目标(DST)标志、操作(OP)标志和结果图像(RES)标志。标志只应用于已定义的矩形(不一定是整个图像)。这些标志的应用顺序如下:
您可以使用位OR (μ)来指定每个组中的一个标志。
集团 | 旗帜 |
定义源矩形处理的标志 | 无,SourceNot, Source0, Source1 |
定义目标矩形处理的标志 | DestinationNot, Destination0, Destination1 |
定义组合数据时要使用的操作的标志 | OperationOr, OperationXor, OperationAdd, OperationSubtractSource, OperationSubtractDestination, OperationMultiply, operationdivesource, OperationDivideDestination, OperationAverage, OperationMinimum, OperationMaximum |
定义结果图像矩形的处理方法的标志 | ResultNot, Result0, Result1, SourceCopy |
某些标志在组合时没有任何意义:
如需更多选项,如指定颜色平面,请使用CombineCommand.
有关更多信息,请参阅处理图像.
下面的示例加载两个图像,并使用“and”操作将它们组合在一起。
使用Leadtools;
使用Leadtools.Codecs;
使用Leadtools.ImageProcessing;
公共无效CombineFastCommandExample ()
{
RasterCodecs codecs =新RasterCodecs ();
字符串srcFileName1 = Path.Combine(LEAD_VARS.ImagesDir,“Image1.cmp”);
字符串srcFileName2 = Path.Combine(LEAD_VARS.ImagesDir,“Image2.cmp”);
字符串destFileName = Path.Combine(LEAD_VARS.ImagesDir,“CombineFastCommand.bmp”);
//从磁盘加载源映像
RasterImage srcImage = codecs.Load(srcFileName1);
RasterImage destImage = codecs.Load(srcFileName2);
//合并
CombineFastCommand命令=新CombineFastCommand ();
//指定目标图像中的位置
命令。DestinationRectangle =新LeadRect (
destImage。宽度/ 8,
destImage。高度/ 8,
destImage。宽度,
destImage.Height);
命令。SourcePoint = LeadPoint.Empty;
命令。DestinationImage = destImage;
命令。旗帜=CombineFastCommandFlags。OperationAdd|CombineFastCommandFlags。Destination0;
command.Run (srcImage);
//保存到磁盘
编解码器。保存(destImage, destFileName, RasterImageFormat.Bmp, 24);
//清理
destImage.Dispose ();
srcImage.Dispose ();
codecs.Dispose ();
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
}
进口Leadtools
进口Leadtools。编解码器
进口Leadtools。ImageProcessing
公共子CombineFastCommandExample ()
昏暗的编解码器作为RasterCodecs =新RasterCodecs ()
昏暗的srcFileName1作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1.cmp”)
昏暗的srcFileName2作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image2.cmp”)
昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“CombineFastCommand.bmp”)
'从磁盘加载源图像
昏暗的srcImage作为RasterImage = codecs.Load(srcFileName1)
昏暗的destImage作为RasterImage = codecs.Load(srcFileName2)
’把它们结合起来
昏暗的命令作为CombineFastCommand =新CombineFastCommand ()
'指定目标图像中的位置
命令。DestinationRectangle =新LeadRect (destImage。宽度\ 8,destImage。高度\ 8,destImage。宽度,destImage。Height)
命令。SourcePoint = LeadPoint。空
命令。DestinationImage = destImage
命令。旗帜=CombineFastCommandFlags。OperationAdd或CombineFastCommandFlags。Destination0
command.Run (srcImage)
将其保存到磁盘
编解码器。保存(destImage, destFileName, RasterImageFormat.Bmp, 24)
“清理干净”
destImage.Dispose ()
srcImage.Dispose ()
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗网络查看器net
188宝金博怎么下载
支持的平台上
.NET、Java、Android和iOS/macOS程序集
C API/ c++类库
HTML5 JavaScript库
您的邮件已发送给技术支持!应该有人联系!如果你的事情很紧急,请回来聊天。
聊天时间:
周一至周五,美国东部时间上午8:30至下午6:00
感谢您的反馈!
请再次填写表格,开始新的聊天。
所有代理目前都离线。
聊天时间:
星期一至星期五
美国东部时间上午8:30 -下午6点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。