←选择平台

结合(LeadRect RasterRegionCombineMode)方法

总结
更新这个RasterRegion结合自身和指定的LeadRect
语法
c#
VB
objective - c
c++
Java
公共过载结合(_按值传递矩形作为LeadRect,_按值传递combineMode作为RasterRegionCombineMode_)
(保龄球)combineWithRect:(LeadRect)矩形combineMode:(LTRasterRegionCombineMode)combineMode错误:错误(NSError * *)
公共无效结合(LeadRect矩形,RasterRegionCombineModecombineMode)

参数

矩形
LeadRect结构相结合RasterRegion

combineMode
其中的一个RasterRegionCombineMode使用枚举成员描述相结合方法。这是不可能的RasterRegionCombineMode.AndNotImageRasterRegionCombineMode.AndNotRegion。使用任何一种组合方法会导致一个异常。

讲话

有关更多信息,请参考RasterRegionCombineMode

例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing;公共无效RasterRegionCombineRectExample (){字符串srcFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1.cmp”);字符串destFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1_CombineRect.bmp”);使用(RasterCodecs编解码器=RasterCodecs ()){/ /加载源图像使用(RasterImage图像=编解码器。加载(srcFileName 0 CodecsLoadByteOrder。BgrOrGray 1,1)){/ /添加一个小椭圆区域image.AddEllipseToRegion (,LeadRect(0, 0,形象。ImageWidth / 3,形象。ImageHeight / 3), RasterRegionCombineMode.Set);/ /得到该地区RasterRegion地区= image.GetRegion ();image.MakeRegionEmpty ();/ /创建一个矩形,适合本地区区域LeadRect rc =LeadRect(0, 0,形象。ImageWidth / 4,形象。ImageHeight / 4);/ /将该地区只包含和矩形之间的区别地区。结合(rc, RasterRegionCombineMode.Xor);/ /设置该区域形象和填充黄色image.SetRegion (、地区RasterRegionCombineMode.Set);FillCommand cmd =FillCommand (RasterColor.FromKnownColor (RasterKnownColor.Yellow));cmd.Run(图片);编解码器。保存(图像、destFileName RasterImageFormat。Bmp、24);}}}静态LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools.Codecs进口Leadtools.ImageProcessing公共RasterRegionCombineRectExample ()昏暗的编解码器作为RasterCodecs ()昏暗的srcFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1.cmp”)昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1_CombineRect.bmp”)“加载源图像使用图像作为RasterImage =编解码器。加载(srcFileName 0 CodecsLoadByteOrder。BgrOrGray, 1, 1)“添加一个小椭圆区域image.AddEllipseToRegion (没有什么,LeadRect(0, 0,形象。ImageWidth \ 3、形象。RasterRegionCombineMode ImageHeight \ 3)。)这个地区的昏暗的地区作为RasterRegion = image.GetRegion (没有什么)image.MakeRegionEmpty ()“创建一种适合本地区的矩形区域昏暗的钢筋混凝土作为LeadRect(0, 0,形象。ImageWidth \ 4,形象。ImageHeight \ 4)”结合该地区只包含的区别和矩形地区。结合(rc, RasterRegionCombineMode。Xor)设置这个地区的形象和填充黄色image.SetRegion (没有什么、地区RasterRegionCombineMode。)昏暗的cmd作为FillCommand (RasterColor.FromKnownColor (RasterKnownColor.Yellow))cmd.Run(图片)编解码器。保存(图像、destFileName RasterImageFormat。Bmp, 24)结束使用codecs.Dispose ()结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

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