本文整理汇总了C#中IImage.GetDistanceBetweenPixelsInclusive方法的典型用法代码示例。如果您正苦于以下问题:C# IImage.GetDistanceBetweenPixelsInclusive方法的具体用法?C# IImage.GetDistanceBetweenPixelsInclusive怎么用?C# IImage.GetDistanceBetweenPixelsInclusive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImage
的用法示例。
在下文中一共展示了IImage.GetDistanceBetweenPixelsInclusive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageBuffer
public ImageBuffer(IImage image, IBlender blender, GammaLookUpTable gammaTable)
{
unsafe
{
AttachBuffer(image.GetBuffer(), image.Width(), image.Height(), image.StrideInBytes(), image.BitDepth, image.GetDistanceBetweenPixelsInclusive());
}
SetRecieveBlender(blender);
}
示例2: copy_from
public void copy_from(IImage src,
RectangleI rect_src_ptr,
int dx,
int dy)
{
RectangleI rsrc = new RectangleI(rect_src_ptr.x1, rect_src_ptr.y1, rect_src_ptr.x2 + 1, rect_src_ptr.y2 + 1);
// Version with xdst, ydst (absolute positioning)
//rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1);
// Version with dx, dy (relative positioning)
RectangleI rdst = new RectangleI(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy);
RectangleI rc = clip_rect_area(ref rdst, ref rsrc, (int)src.Width(), (int)src.Height());
if (rc.x2 > 0)
{
int incy = 1;
if (rdst.y1 > rsrc.y1)
{
rsrc.y1 += rc.y2 - 1;
rdst.y1 += rc.y2 - 1;
incy = -1;
}
int getDistanceBetweenPixelsInclusive = src.GetDistanceBetweenPixelsInclusive();
while (rc.y2 > 0)
{
base.CopyFrom(src,
rdst.x1, rdst.y1,
rsrc.x1, rsrc.y1,
rc.x2 * getDistanceBetweenPixelsInclusive);
rdst.y1 += incy;
rsrc.y1 += incy;
--rc.y2;
}
}
}