c#
VB
objective - c
c++
Java
公共类CropCommand:RasterCommand
公共类CropCommand
继承了RasterCommand
@接口LTCropCommand: LTRasterCommand
公共类CropCommand扩展RasterCommand
公共ref类CropCommand:公共RasterCommand
这个例子从图像的每一侧修剪了100个像素。
使用Leadtools;
使用Leadtools.Codecs;
使用Leadtools.ImageProcessing;
公共无效CropCommandExample ()
{
RasterCodecs codecs =新RasterCodecs ();
字符串srcFileName = Path.Combine(LEAD_VARS.ImagesDir,“Image1.cmp”);
字符串destFileName = Path.Combine(LEAD_VARS.ImagesDir,“CropCommand.bmp”);
//从磁盘加载源映像
RasterImage image = codecs.Load(srcFileName);
//从图像两边各裁剪100像素
CropCommand命令=新CropCommand ();
命令。矩形=新LeadRect (
One hundred.
One hundred.
的形象。宽度- 100,
的形象。身高- 100);
command.Run(图片);
//保存到磁盘
编解码器。Save(image, destFileName, RasterImageFormat.Bmp, 24);
//清理
image.Dispose ();
codecs.Dispose ();
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
}
进口Leadtools
进口Leadtools。编解码器
进口Leadtools。ImageProcessing
公共子CropCommandExample ()
昏暗的编解码器作为RasterCodecs =新RasterCodecs ()
昏暗的srcFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1.cmp”)
昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“CropCommand.bmp”)
'从磁盘加载源图像
昏暗的图像作为RasterImage = codecs.Load(srcFileName)
“从图像两侧各裁剪100个像素
昏暗的命令作为CropCommand =新CropCommand ()
命令。矩形=新LeadRect(100,100, image。宽度- 100,图像。身高- 100)
command.Run(图片)
将其保存到磁盘
编解码器。保存(image, destFileName, RasterImageFormat.Bmp, 24)
“清理干净”
image.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点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。