←选择平台

ClearCommand类

总结
设置指定图像中的所有位为0,使它成为黑人的形象。
语法
c#
VB
objective - c
c++
Java
公共ClearCommand:RasterCommand
公共ClearCommand继承了RasterCommand
@接口LTClearCommand: LTRasterCommand
公共ClearCommand扩展RasterCommand
公共ref类ClearCommand:公共RasterCommand
讲话

集所有位为0,在指定的图像。如果图像有一个调色板,所有像素的颜色调色板条目。

有关更多信息,请参考与LEADTOOLS介绍图像处理

例子

这个例子将清晰的图像保存到磁盘。

c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing;公共无效ClearCommandExample (){RasterCodecs编解码器=RasterCodecs ();字符串srcFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1.cmp”);字符串destFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1_clear.bmp”);/ /加载从磁盘源图像RasterImage图像= codecs.Load (srcFileName);/ /清晰的图像ClearCommand cmd =ClearCommand ();cmd.Run(图片);/ /将图片保存到磁盘codecs.Save (形象,destFileName,RasterImageFormat.Bmp,24);/ /清理image.Dispose ();codecs.Dispose ();}静态LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools.Codecs进口Leadtools.ImageProcessing公共ClearCommandExample ()昏暗的编解码器作为RasterCodecs =RasterCodecs ()昏暗的srcFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1.cmp”)昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1_clear.bmp”)“从磁盘加载源图像昏暗的图像作为RasterImage = codecs.Load (srcFileName)清晰的图像昏暗的cmd作为ClearCommand =ClearCommand ()cmd.Run(图片)将图像保存到磁盘codecs.Save (形象,destFileName,RasterImageFormat.Bmp,24)的清理image.Dispose ()结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools组装
188金宝搏的网址客服|支持|联系我们|知识产权的通知
©1991 - 2021领先的技术公司。保留所有权利。